There are a few threads on a few different aspects of this but I have not found a single thread that recounts what I discovered when I did this recently.
Your experience may be different to mine - feel free to comment (if you have qualified experience please!).
Note I moved from:
/home/domain_account/public_html/_old_site/my_joomla_name to
/home/domain_account/public_html/_new_siteAlso, I am not using the cart - I'm just set up as a catalog.
I had to change 2 files and one table.
1) The joomla
configuration.php;
2) The VM
virtuemart.cfg.php; and
3) The contents of the table
jos_vm_product_files.
TRAILING AND LEADING SLASHES were my downfall!There may be other data changes required for you - but this (as of today - I only moved yesterday) seemed to be enough for me.
1) In the joomla_root file
configuration.php change:
1a)
$mosConfig_absolute_path to the new absolute path (eg. '/home/domain_account/public_html/_new_site'

1b)
$mosConfig_live_site to the new live url (eg.
http://www.new_site.com'

Note - there are no trailing slashes on the paths - this may be different for you but I found it crucial for me - I'm not sure if it depends on the original config file but it may be relevant.
What I found was the above specification, coupled with the following, worked a treat.
2) In the joomla_root/administrator/components/com_virtuemart virtuemart.cfg.php file change as follows:
2a) comment out or delete this block of code:
// Check for trailing slash
//if( $mosConfig_live_site[strlen( $mosConfig_live_site)-1] == '/' ) {
// $app = '';
//}
//else {
// $app = '/';
//}
// these path and url definitions here are based on the mambo configuration2b) Make sure you have...
define( 'URL', $mosConfig_live_site.'/' );
define( 'SECUREURL', 'https://www.new_site.com/' );
if ( @$_SERVER['HTTPS'] == 'on' ) {
define( 'IMAGEURL', SECUREURL .'components/com_virtuemart/shop_image/' );
} else {
define( 'IMAGEURL', URL .'components/com_virtuemart/shop_image/' );
}
define( 'COMPONENTURL', URL .'administrator/components/com_virtuemart/' );
define( 'ADMINPATH', $mosConfig_absolute_path.'/administrator/components/com_virtuemart/' );
define( 'CLASSPATH', ADMINPATH.'classes/' );
define( 'PAGEPATH', ADMINPATH.'html/' );
define( 'IMAGEPATH', $mosConfig_absolute_path.'/components/com_virtuemart/shop_image/' );
The presence and absence of the leading and trailing slashes is CRUCIAL. Before I had this config most things in the front end seemed to work but then when I was in the backend admin I started to get redirected to the mysql.com admin page (seriously!) when in Firefox and I got a page not found in IE. I then noticed that in IE I was being directed to
http://administrator/index2.php. Hmmmm...
Also, I then noticed in the front end I was getting double and triple slashes on some urls and none in others. For example:
http://www.new_site.comxyz.php ranging through to
http://www.new_site.com///xyz.php (the majority where double and triple - and they still worked in apache at least).
(As an aside - this was occurring because some of VM appears to be using the secure URL where it may not always be needed - for example on the "advanced search" link in mod_virtuemart (it seems that way to me) there's probably a reason - but let's not go there - it's not that important....)
As mentioned - the correct positioning of the slashes was the solution.
But wait - there's more.
3) I then noticed that some of my images - the extra ones that I added to my "products" with the "FileManager" - were not displaying. On examination of the table that holds these links (jos_vm_product_files) I found that the old IMAGEPATH and had been stored as a literal in the "file_name" column and the old URL had been stored in the "file_url" column. Easily fixed with SQL.
Any others you've noticed?
The SQL I used to do the updates was along the following lines:
file_name:UPDATE jos_vm_product_files
SET file_name =
(CONCAT('/home/domain_account/public_html/_new_site', SUBSTR(file_name FROM INSTR(file_name, 'my_joomla_name')+14)))
WHERE file_name REGEXP '^/home/domain_account/public_html/_old_site/my_joomla_name'
file_url:UPDATE jos_vm_product_files
SET file_url =
(CONCAT('http://www.new_site.com', SUBSTR(file_url FROM INSTR(file_url, 'my_joomla_name')+14)))
WHERE file_url REGEXP '^http://www.old_site.com/'I'm not real good at SQL so there may be a better way to do this.....?