Skip to content

Changing Hosting Services

mikert edited this page Mar 21, 2011 · 1 revision

Moving the Database

SQLite

Backing up a SQLite database is easy since it's just one file on your host. To back up a SQLite database, simply load your FTP client and download it. If you have forgotten where you placed it, just download "config.cgi" from your Melody directory. If you selected SQLite, there will be a line in there which tells you where you SQLite database is located on the server.

MySQL

To back up a MySQL database, you have two choices:

  1. The MySQL command line client.
  2. phpMyAdmin.

Most hosting services have both. For casual and novice users, phpMyAdmin is by far the easiest route. Your hosting service can provide you with the URL for their installation of phpMyAdmin. It varies from host to host, but if they have CPanel installed, it is often linked on the main page of your CPanel admin console.

MySQL Command Line Client

The instructions below assume that you have created a database on your new host and have assigned a database user to that new database.

  1. Log into your old host via SSH.
  2. Run mysqldump -u DATABASE_USERNAME -p DATABASE_NAME > melody.sql
  3. Download melody.sql via FTP.
  4. Upload melody.sql to your new host.
  5. Log into your new host via SSH.
  6. Run mysql -u DATABASE_USERNAME -p DATABASE_NAME < melody.sql

phpMyAdmin

Export Process:

  1. Log into phpMyAdmin using your old host's instructions (contact their technical support, if necessary).
  2. Select your blog's database in the left-hand side listing of databases.
  3. Click on the "Export" tab in the top right corner.
  4. In the Export page, ensure that all tables are selected under the heading labeled "Export."
  5. Ensure that the checkbox labeled "Save as file" is checked.
  6. Assign the export file the name "melody.sql."
  7. Don't use any compression if your database is large (larger than 50MB).
  8. Click on the button labeled "Go."

Import Process:

  1. Log into phpMyAdmin on your new host.
  2. Select your new blog database in the left-hand side listing.
  3. Click on the "Import" tab in the top right corner.
  4. Click on the "Choose file" button.
  5. Select melody.sql on your computer.
  6. Ensure that the "SQL" checkbox is selected.
  7. Click on the button labeled "Go."

If you encounter any problems during the import process, contact your hosting service. They should be able to import the SQL for you if you encouter any problems. They will likely only ask that you upload the melody.sql file by FTP to their server.

Moving Your "Assets"

Piece by Piece

This one is a bit tricky for some users. The most common "gotcha" that people run into here is not moving their assets into an equivalent location on their new host.

Suppose you published your blog to /home/johnsmith/public_html/ on your old host. Your new host tells you that your public web folder is /home/smithjq/www/.

What you would do here is more or less download everything from /home/johnsmith/public_html/ on your old host and copy it over, folders and all, into /home/smithjq/www/ on your new host via FTP. For many users, this will be a long and laborious process as the FTP client has to meticulously download a whole lot of content from one host and then upload it to another. It is also the easiest process for tech support at either host to help you with.

All At Once Via A Zip File

Depending on how your old host and new host allocate your space, you may be able to use CPanel's file manager to zip up the contents of your entire home directory. The process for doing this is simple:

  1. Log into CPanel on your old host.
  2. Open the file manager (and tell it to open you up into the public html folder).
  3. Click on the "select all" button underneath the right hand side file listing.
  4. Click on the button labeled "Compress."
  5. Give it a name like "oldblog.zip." Keep the path in the file name text field.
  6. Click on radio button next to "zip."
  7. Click on the button labeled "Compress File(s)."
  8. Download the file to your computer.
  9. Upload the file by FTP to /home/smithjq/www/
  10. Open up CPanel's file manager on your new host.
  11. Select the zip file you uploaded.
  12. Click on the button labeled "Extract."
  13. Delete the zip file from both hosts.

Install Melody On The New Host

  1. You can copy your Melody installation verbatim from your old host.
  2. Edit config.cgi and update the following fields:
    • CGIPath
    • StaticWebPath
    • StaticFilePath
    • Database
    • DBUser
    • DBPassword
    • DBHost (might be necessary, ask your new host where MySQL is installed)
  3. Reset the permissions on Melody; In CPanel or your FTP client, set Melody's folder and CGI files to "755."
  4. Go through each blog and update the file path under "Blog Settings."
  5. Republish each blog.

That's all there is to making the big change. Since Melody stores almost everything in its database, you don't have to worry about copying over your old published files. The only reason you might want to bring them over is to help you mask the transition while you're setting everything up and republishing.

Clone this wiki locally