[support] How to move my sites

Jeff Brown jeff at wildcoast.com
Sat Oct 8 13:29:01 UTC 2011


On Sat, 2011-10-08 at 08:49 -0400, James Rome wrote:
> I need to move my sites to a new host. What is the procedure for doing
> this, especially the backup and restore of the database? Does the
> hosting-specific information reside inside the database? If so, how do I
> change them? The page URLs will not be changed.

If you have SSH access:

mysqldump -u username -p yourdatabase > yourdatabase.sql

To restore on the new server, you need to create the database first:

mysqladmin -u username -p create yourdatabase

Then:

mysql -u username -p

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON
yourdatabase.* TO 'username'@'localhost' IDENTIFIED BY 'password';

To import the database:

mysql -u username -p yourdatabase < yourdatabase.sql

...
Copy the Drupal files into the html directory, make sure that your
database & $base_url settings in /sites/default/settings.php match up,
and you're good to go.

If you don't have SSH, I'm sure you can figure out how to do the
equivalent with phpmyadmin.

If you're not working in a sub-directory (E.g.
www.sitename.com/yoursite), then the hosting specific data should all be
based on relative paths (i.e. "/sites/default/files" and shouldn't need
any changes. But do check out for the $base_url if you are changing
domain names.

HTH



More information about the support mailing list