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.
Thanks, Jim
URL: http://jamesrome.net
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
On 08/10/11 15:29 +0200, Jeff Brown wrote:
On Sat, 2011-10-08 at 08:49 -0400, James Rome wrote:
If you have SSH access:
mysqldump -u username -p yourdatabase > yourdatabase.sql
[...]
mysql -u username -p yourdatabase < yourdatabase.sql
I ran into encoding problems doing it this way. It might have been caused by different mySQL versions on the servers. YMMV. I would recommend using options to specify the encoding (f.i. --default-character-set=utf8).
regards Rolf
On 08/10/11 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.
You can use the backup&migrate modul to backup your database on one host and restore it on the other.
regards Rolf
I would recommend after getting the Back up and Migrate SQL dump from your current site, Go to your new host and upload all your files, Go into sites->default and rename the settings.php file to something like old-settings.php Then make a copy of default.settings.php and rename it to settings.php On your new server, create your DB and DB-user Then run the Drupal install like you were installing a new site Then import the SQL dump file from the old site
That should do it.
The first step should always be to ask the new host if they will do it. Many will do it for free.
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: James Rome
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.
Additionally to all great advice above, I would empty the cache just before dumping the database.
When setting up a new mysql installation, it is useful in the long run to make sure that the default character setting is uft-8. I wrote a tutorial about that a while ago, because I ran into issues with the feed aggregator: http://upsitesweb.com/blog/2011/08/drupal-7-feed-aggregator-issue-mysql-char...
Ursula
On Sat, Oct 8, 2011 at 9:00 AM, Ms. Nancy Wichmann nan_wich@bellsouth.netwrote:
The first step should always be to ask the new host if they will do it. Many will do it for free.
*Nancy*
Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
*From:* James Rome
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.
-- [ Drupal support list | http://lists.drupal.org/ ]
The Back_Migrate module has a setting for which tables to include only the structure. I would do that for all cache tables, sessions, and watchdog. Depending on what you use accesslog for, that one maybe. (Actually, I try to discourage accesslog use entirely.)
Nancy Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.
From: Ursula Pieper
Additionally to all great advice above, I would empty the cache just before dumping the database.
When setting up a new mysql installation, it is useful in the long run to make sure that the default character setting is uft-8. I wrote a tutorial about that a while ago, because I ran into issues with the feed aggregator: http://upsitesweb.com/blog/2011/08/drupal-7-feed-aggregator-issue-mysql-char...