views:

58

answers:

3

hi,

how can I change my Drupal filesystem root in the database ? I moved Drupal to another path. I'm looking for this value to update in the database. thanks

A: 

<EDIT>if you want to change it in the database (why?), you can do it by changing the value of file_directory_path in the variable table:

UPDATE variable SET file_directory_path = 's:5:"files";';

values in the variable table are stored as serialized php variables. the serialized value in the example above means file_directory_path is a string (s) of length 5 with the value files. you have to adapt this to your specific value.

also note that Drupal variables are cached (in the cache table, under the cid variables). for your change in the database to take effect, you have to clear that cache, like DELETE FROM cache WHERE cid = 'variables';.</EDIT>

if you mean the File system path: it's at Administer > Site configuration > File system, or http://yourdrupalsite.com/index.php?q=admin/settings/file-system.

ax
yeah I mean the file system path, but I meant changing it in the database, not using drupal
Patrick
see my updated answer.
ax
sorry I guess there is my misunderstanding. In Drupal database there are only relative paths (starting from the Drupal root folder) and not an absolute one (i.e. /web/Drupal) specifying where Drupal is installed, right ? This is what I meant
Patrick
yes: Drupal paths are relative to the Drupal root folder. this root folder, however, is not stored anywhere in the database. there is no need for it. if you move your installation to a new folder and can call its index.php from a browser, it will just work.
ax
if it doesn't try clearing all the caches...
barraponto
so is your question answered?
ax
A: 

Funny, I just had to do that yesterday.

Since i have phpmyadmin available to me, I used that to export the files table, then do some search/replace routines, then import the table, overwriting the data.

But had I not had phpmyadmin to help, I would have created an SQL query to replace the outdated paths...

Michael D
hi! I thought that the main location of drupal installation on the server was stored only once. (Then all the relative paths.. (i.e. sites/files... ) are repeated a lot of times, but I don't need to change them.
Patrick
A: 

Funny, I just moved my drupal to another folder, and it was working. Probably I didn't explain my question very well..

Patrick
patrick - that is exactly what i said in a comment to my answer. please don't take other peoples info and make it into your own, *accepted* answer. thanks!
ax

related questions