Support

Documentation

Special VirtueMart considerations and things you need to do to move sites with VirtueMart on another host/server/domain/directory

If you are trying to restore a VirtueMart shop to a different server, domain, subdomain or directory than the original site you will discover that it stopped working. This is due to VirtueMart storing absolute URLs and absolute paths in its configuration. They are very easy to change. Start by opening the administrator/components/com_virtuemart/virtuemart.cfg.php file with a plain text editor (e.g. Notepad, but not WordPad). Find the two lines looking like this:

define( 'URL', 'http://www.example.com/' );
define( 'SECUREURL', 'https://www.example.com/' );

These two lines contain the URLs to your regular site's root and to your HTTPS site's root. Edit them to match your new settings. For example, if you moved your site to http://shop.example.com the above lines should now read:

define( 'URL', 'http://shop.example.com/' );
define( 'SECUREURL', 'https://shop.example.com/' );

Finally, if you are offering downloads as products, you will also have to change the download root directory. Find the line which looks like this:

define('DOWNLOADROOT', '/home/myuser/public_html/vmdownloads');

and change the path to reflect the absolute filesystem path to your downloads directory. Determining it is not so difficult. During the restoration you are presented with the absolute path to your new site's root in the Fine-Tuning section of the Site Info (second to last) page. Let's say that this path is /home/foobar/www and your VirtueMart downloads directory is vmdownloads under your site's root. The new path you have to type in is, therefore, /home/foobar/www/vmdownloads.

If you are wondering why ABI can't handle this automatically, do note that out of the three changes illustrated here only one can be automated: the regular site's root. The secure URL may or may not be the same as the normal URL, with or without HTTPS or it can be a completely different URL than the regular site's URL! There is no way ABI can know that. The downloads root is even trickier, as ABI would have to know the path layout of the original server, parse the path against it and re-parse it against your current directory structure. This is pretty much a hit-and-miss operation so you're really better off doing those changes manually than having an automated system routinely mess up your settings on restoration.