I am in the process of migrating a Drupal 6.19 site from the localhost to the server. I followed all of the procedures, created a DB, imported the DB from the localhost, placed all the Drupal files on the server and the site launched correctly. However, the when I went to the admin/settings/file-system page I received this error message: "The directory sites/default/files does not exist". I understand that Drupal will build this file dynamically if I change the permissions. So after reading some Drupal posts I changed the sites/default folder from 755 to 777. Then I received this message (after the sites/default/files folder was created), "The directory sites/default/files is not writable". I then changed the sites/default/files folder to 777 but Drupal didn't add the css files/files in this folder as it typically does. The only thing it added was a .htaccess file which is now causing issues with the site.

Can someone help me with the correct process with permissions when migrating a site to the server? I am confused because many of the instructions about installation refer to migrating a brand new site and I am migrating a built site w/database.

Is this the correct procedure (after you have moved the files to the server and imported the db)
1) chmod 666 to both the sites/default/settings.php and the default.settings.php
2) Then chmod 777 the sites/default folder

Do I have to chmod the sites/default/file folder after it is created?

Thank you in advance for your help!

Comments

smira’s picture

You are performing what I like to call a “manual migration”, probably via FTP, which always causes permission problems.

What I would suggest you do is download and install the following modules
http://drupal.org/project/backup_migrate
http://drupal.org/project/backup_migrate_files

simply delete the database and installation on your live server and create a new one 'clean' one, then you can install and activate the above modules, and import the files and database using them, thus bypassing the need for messy FTP transfers and permission issues.

if you search for it there is also a script you can run to fix permissions in your drupal installation, but i can't find it for you right now.

just as a reminder folder permissions (except files folder) are 755 (777 for files folder), 644 for files

J.Murphy’s picture

Thank you I will try using those modules. I appreciate your help. If I can ask one more question, I typically use SSH to import larger databases. Will the backup_migrate and backup_migrate_files modules be able to handle larger databases, say 20MB or more?

smira’s picture

should be.. depends on your max upload settings.
mine claims to accept files up to 100 MB but i'm not sure i want to try it ;)
if you can't upload larger files it's either a drupal setting or a php.ini setting... could by a mysql setting too...
your best bet then would be to ask your hosting company

lsdoc77’s picture

For big databases I find very usefull the MySql Dumber (http://www.mysqldumper.net/) which works through azax and can handle big db sizes that otherwise would fail because of restrictions on script execution time...

lsdoc77’s picture

I have to mention that I had some problems with backing up and restoring db with mysqldumper so I sticked with backup and migrate module which worked fine..

philade’s picture

This problem arose when you try to write to your core Drupal installation without the right permission and Drupal did not know the full path to the temp folder.

To resolve this problem follow this simple step

navigate to
Home » Administration » Configuration » Media

Copy the entry in the "Public file system path"
mine is "sites/default/files"

move the copied entry into the front of the Temporary directory entry
you should see something like this in the field
"sites/default/files/tmp" without the quotation marks

Save configuration

error gone!!!!