Forum Moderators: phranque
I have an E-commerce site running on an VPS hosting and I want to move my site to another shared hosting.
1)What are some of the steps that I need to take in order for a smooth transition from one host to another?
2) DO I need to create an identical database with DB name and DB password on the new host first? Then import the MySQL dump file from current DB file, if thats the case how do you import it?
1. Setup new server with all required software and versions.
2. Migrate all my website files over (scripts, images, etc)
3. Create the database using mysqladmin. Create the power user account.
4. Now this part is the tricky part. I like to move my db over before my site is moved. I disable db updates for 30 minutes on my live site with a MSG saying we are doing some work. Then I export the database and import it on the new server using:
mysql -p dbname < mysqldump.sql
Once the data is loaded, I test it via my website scripts already on the new server. If all looks good, I then change the database connection string on the old server to point to the new server. Note your old site is still live on the old server. You will just be connecting to the new db remotely.
Once that is done, you can do a DNS cutover to the new server at any time, since both the old and the new server are now using the new database, it will remained synced.
One important note, when you create the db user on the new server, you need to specify the ip of your old server in the hostname field of the user account. Essentially this allows remote login from your old server. Then create a second duplicate account with localhost as the hostname for your new site scripts to use when connecting.
Hope this helps.