It may be time for a rebuild

joomlaIf you've uninstalled and installed lots of software or if you've performed one too many upgrades, you might find that you need to rebuild your Joomla site from scratch.


Extensions

Make a note of any extensions that you are using on the old site. Depending on how familiar you are with the extension, you may need to install it from scratch on the new site.

 

New site

Start by performing a clean install using the latest version of Joomla 3.x. Note that for this article the old database tables are prefixed vwxyz_ and the new tables use abcde_. After the clean install is complete, export a .csv file of the new abcde_menu table for later reference.

 

Exporting tables from old site

Now you need to export tables.  Here's how to do it using phpMyAdmin...

  1. Select the appropriate table and choose the Export tab.
  2. Do a Quick SQL export and then click Go.

Using phpMyAdmin export the following tables from your old database:

  • vwxyz_categories
  • vwxyz_content
  • vwxyz_content_frontpage
  • vwxyz_menu
  • vwxyz_menu_types
  • vwxyz_usergroups
  • vwxyz_users
  • vwxyz_user_usergroup_map

These are the main content tables, and depending on your site you may decide to export more.

Be careful when migrating users, as you will need to copy the salt secret from your old site, in order to preserve passwords on your new site. You might also need to be careful with user groups.

Import the tables into the new site

Before importing the vwxyz_menu table, download a .csv file of abcde_menu (include the column name in the first row). You will see 20 menu items of menutype main. Also note that a clean install only has one record in the abcde_menutype table, namely the mainmenu menu type.

Now you can import the tables to your new database...

  1. Select the new database and choose the Import tab.
  2. Click the Choose file button to browse to your downloaded SQL file and click Go.

Your imported tables will have the prefix from your old database. You can now delete your new empty tables and rename the imported tables to match the prefix of your new database.

Select the existing tables in the new database, and then drop them.

  • abcde_categories
  • abcde_content
  • abcde_content_frontpage
  • abcde_menu
  • abcde_menu_types
  • abcde_usergroups
  • abcde_users
  • abcde_user_usergroup_map

Now you can rename the imported tables with the prefix of vwxyz_ to abcde_ in line with your new database.

  1. In PHPMyAdmin, select each of the tables.
  2. Select the Operations tab.
  3. Rename the table with the new prefix, and click Go.

If you've imported user accounts, don't forget to copy the salt secret from your old site.

Now you can delete all main menutype items in the abcde_menu table and then upload from your 'clean' .csv file I removed the root record and the home item so that all that was left was the clean main menutype items.

 

Images and CSS

You will also typically want to migrate the entire /images folder.

If you've made custom CSS changes (e.g. user.css in Protostar) you will need to migrate them manually.

 

Updating the Author

If you're installing a fresh install of Joomla, the author id may have changed for your articles.  You can run the following SQL in phpMyAdmin to change the Author for all articles in one go, where the user id is 614.

UPDATE abcde_content SET created_by = 614 WHERE 1;
UPDATE abcde_content SET modified_by = 614 WHERE 1;
UPDATE abcde_categories SET created_user_id = 614 WHERE 1;
UPDATE abcde_categories SET modified_user_id = 614 WHERE 1;

 

Thanks for visiting.