I am a complete newbie to backend management of an ecommerce platform. I am looking for a simple answer to the question“What are the steps I should take (Please treat me as an idiot) to upgrade to a new version of Magento?” Do I need ftp access to the Magento file or is there a way to upgrade through the admin panel? I have been tasked with upgrading a live store and don’t want to blow up the current site.
The easiest way to upgrade is to clone your database and install a brand new Magento over it. Then if everything is ok - switch your virtualhost or whatever you have - to it.
Checkout from repository is a straighforward way to pump the latest available release to your server. See http://www.magentocommerce.com/svn
Let’s assume you have a dedicated server that meets Magento requirements. You are able to manage your mysql databases as superuser, you are able to create virtualhosts. Your current Magento installation is at one of the virtualhosts.
Also you’ll need svn client installed. The newer the better.
At first, let’s clonedatabase “magento” into “magento_new”:
cd ~ mysqldump -uroot magento > magento.sql mysql -uroot > create database magento_new; exit; mysql -uroot magento_new < magento.sql
Now let’s create a new virtualhost for our staging installation that we’ll attempt to update. Once it is created, pump the freshest Magento into the document root:
cd /path/to/new/document_root/ svn co http://svn.magentocommerce.com/source/branches/1.3 .
Magento will require some dirs writeable:
chmod -R o+w var chmod -R o+w media chmod -R o+w app/etc
Once checkout is finished, launch your Magento as new virtualhost. You’ll see an installation wizard. Install Magento, specifying “magento_new” database credentials. Don’t forget to specify the same encryption key that was in your old installation.
If you get a fatal error during installation, ask a developer for help.
After Magento is installed, you may make your app/etc/local.xml file non-writeable. Remember, that a broken database is the root of evil for your installation. To make sure your database will be consistent, run the database repair tool to check/fix database structure: http://www.magentocommerce.com/wiki/doc/db-repair-tool (currently this tool isn’t officially released, but will be soon).
Then upgrade your custom themes (if there were any) to make them compatible with new version and then install them. As well as custom modules you used. These tasks are for developers and html coders.
Now, theoretically, your installation is upgraded and usable. Depending on size of your database and customizations, the whole process can take from 10 minutes up to weeks of work.
When new version comes out, you can again clone your database, but this time clone your document root as well. To upgrade your Magento Core files, you need to know what repository url is used for your installation:
cd /your/another/new_cloned_virtualhost svn info
After that, compare this URL with official latest available stable svn release. If it is the same, you’ll need to run:
svn up
If different, before updating you’ll have to switch your working copy to the new repo URL. See manual how to do it http://svnbook.red-bean.com/
And after getting updated structure from repository, before running Magento, clean cache. It is essential:
rm -rf /var/cache
After each update of the core files, all your customizations must be checked for compatibility and updated…
If you do not have the permission to create virtualhost, you can follow this wiki: http://www.magentocommerce.com/wiki/upgrading_magento
I know I am not suppose to upgrade without first backup the database and everything, but I have a staging server and I just use MagentoConnect on it first, check that the update is ok, then use MagentoConnect on the production. The staging server is almost the exact mirror of the production, differences are the URL configurations in the database. So in a way, the staging server acts as a backup.
Still, creating virtualhost is definitely a much better solution as you can fall back to the last version instantly.
Thanks for the replies. I am a bit afraid I am in over my head on this point. (My background is content management of Ecommerce, not DB management...) I will look into what permissions I have for the DB and server and if I get stuck I’ll be back here asking for more help!