4

I currently have a live Joomla (3.x) website on a shared hosting environment, I'd like to replace this site with a new Joomla (3.x) website I have on my localhost (XAMPP) environment.

What's the best way to approach this in order to ensure minimal downtime?

The process I normally follow is;

  • backup my local Joomla site using Akeeba
  • upload the backup file (.jpa) and Akeeba Kickstart to the live root directory
  • zip root directory contents (excluding the jpa and kickstart)
  • proceed with Akeeba Install

Providing the Akeeba install goes smoothly (which it normally does), the downtime is only minutes. However I'm just wondering if there's a better approach, in the event that something doesn't go as expected? For example, creating a temporary index holding page, or having a temporary domain etc.

Thanks

3 Answers 3

4

If you have enough rights on the server, I do it without any downtime and without Akeeba. I use a script like

  1. Make a dump of the mysql joomla database, store the file in a directory which is not readable by apache server (not accessable through user www-data [ubuntu, etc] or http [arch linux,..]):

    mysqldump -h hostname -u user --password=password databasename > filename

  2. RSYNC the whole installation

    rsync -avz <server>:/<joomla_directory> <joomla_directory_localhost>

    exclude some files like the configuration.php if necessary...

  3. READ-IN the database file mysql -h hostname -u user --password=password databasename < filename

Security:

Use a password file instead of --password=password if the servers are used by multiple users because anyone could read the password from the process line during the database dump.

I do these steps not only synchronizing for a test server on localhost, but also mirroring the whole server to another location once a day.

Maybe there is a better solution?

3

There are a couple of approaches. Using @Tom Kuschel suggestion with rsync if you have such privileges is one. But there are others as well.

If the only changes are on the db level, you could simply create the new database, import your data and then connect Joomla to that database.

Connecting Joomla to another database (and remote databases) can work also when you transfer the site from one server to another alongside with DNS changes, assuming you can allow remote connections to the database.

If you also need to update the code base, then it's always better to have deployed and tested the new version on the server. I usually first setup the new version on a subfolder make sure it works as expected (that includes having the customer to review/test it) and then I switch.

For switching I usually put the old website files inside a folder, and then move the contents of the subfolder of my test version to the document root. When I confirm everything is in place, I am changing the log/tmp directory paths if required on the configuration.php and I am done. This is usually only some seconds task.

It is also possible to change the document root of the hosting account to point to that new directory. This way, the switch will be instant. Consult the documentation of your control panel or ask support from your hosting provider for this.

Some additional thoughts regarding downtime for maintenance and updates: After the years and many migrations/site moves, I have concluded that some minimum downtime in many cases is acceptable, preferable, and in some cases necessary.

The more professional approach is to have scheduled and informed all those that are involved/using the site about this and have prepared a temporary page to display during the migration. I suggest to have first try the migration to have an idea of the time it will take alongside with other things that might come in your way.

All these are more important if the website you are working has user updated content. Such migrations are a whole different thing than a rather static website. You need to ensure that your new version will have all the latest content. So in such cases you need a very good plan that has been tested before. And of course you can't avoid downtime.

3

When we do a site upgrade like this we use a temp folder and Akeeba. Simply create a new folder for for the updated site and install it using Akeeba. Make sure you use a new database so the entire new site is fully functional in the folder. Once you are satisfied that everything works, move the entire current Joomla install into a folder, then move the new Joomla install into the root. Using the cPanel file manager this takes less than a minute to move the files around, plus if something goes wrong, it's very easy to switch the versions around again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.