Restoring a WordPress sql file

From Habari Project

Jump to: navigation, search

This page or image is a candidate for deletion. The given reason is: Moved information to Importing Content page.

This notice should remain for a minimum of 1 week after it was placed on the page. If discussion is still ongoing, it should remain until a consensus is reached, after which the page will either be deleted or this notice removed.

If you disagree with its deletion, please discuss your reasons on this page or on its associated talk page, as applicable.

Remember to check if anything links here and the page history before deleting.

If you have a SQL file that you've exported from your original WP database, then converting it to Habari is reasonably simple.

You need to restore that SQL backup file to your MySQL database so that Habari can read the data from it.

You have two options for restoring your database. You can use phpMyAdmin via the web to restore the data, or you can use the command line on your server.

To use phpMyAdmin, you must have phpMyAdmin already installed on your server. It is possible to do this yourself if it's not already done, although many hosts already have this installed. Note that installing phpMyAdmin is more complicated than installing Habari, and is outside the scope of what I will describe here.

Assuming you have phpMyAdmin running, you should either create a new database on your server or connect to the existing Habari database. It is going to be a better option to create a new database since you will not need the data from that datbase after you have imported it into Habari's own database. If you import directly into Habari's database, you will have to delete the old WordPress tables individually if you do not want them, which requires a few extra steps that deleting a whole database does not. Either way is pretty trivial.

Whatever database you choose, click the Import option for that database, then choose the SQL file to upload. Submit the form to restore your WordPress backup to that database.

If you're doing this from the command line (via SSH, via Putty), upload the sql file to your server where you can access it. Execute the following command:

mysql -u{username} -p {database} < {sqlfile}

Substitute the username, the database name, and sql filename where needed, and supply the correct password when requested.

When your WordPress database is ultimately restored, you can proceed with the import into Habari.

When the import is complete, you can delete the WordPress database (if you restored the backup to its own database) or the WordPress tables from your Habari database.

reprinted from a post by ringmaster on habari-dev

Personal tools