Welcome, Guest. Please login or register.
Login with username, password and session length


Need help or want to talk to other developers? Join the VirtueMart Chat! Read more...

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1]   Go Down
Print
Author Topic: How to move a site  (Read 23217 times)
bpresent
Newbie
*
Posts: 10


WWW
« on: August 11, 2006, 01:00:26 AM »

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_site


Also, 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'Wink
1b) $mosConfig_live_site to the new live url (eg. http://www.new_site.com'Wink

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 configuration


2b) 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.....?
Logged

My first Joomla site and VirtueMart catalog http://www.minilps.net
Joschg
Newbie
*
Posts: 8


« Reply #1 on: February 15, 2007, 09:14:14 AM »

I'm facing same problem.
But if I have $mosConfig_live_site = 'http://www.elitemedicalmall.com';
links in store don't work, the / is dropped after the domain

I tried your solution, but if I have
$mosConfig_live_site = 'http://www.elitemedicalmall.com/';
in configuration with slash the prodcuts work fine, but I get // in all top menu items (Joomla)

Any idea?
 
Logged
bpresent
Newbie
*
Posts: 10


WWW
« Reply #2 on: February 15, 2007, 20:05:52 PM »

Hard to say without going into a lot of research but if that's the only place that it's happening then you may look at the module (or whatever) that is used to build that top menu and look at how the URLs are being built.

Also, if you are eventually planning on generating "OpenSEF" URLs I've found it's always best to use $sess->url to buid the URLs so that they are always built the same way from everywhere in the site.

What module or whatever is being used to build your top menu?
« Last Edit: February 15, 2007, 20:08:47 PM by bpresent » Logged

My first Joomla site and VirtueMart catalog http://www.minilps.net
bpresent
Newbie
*
Posts: 10


WWW
« Reply #3 on: February 18, 2007, 20:08:00 PM »

I noticed you've fixed it - care to share with us what you did?  I'd be curious to know. Thanks, Sam.
Logged

My first Joomla site and VirtueMart catalog http://www.minilps.net
Andy Armitage
Jr. Member
**
Posts: 52


« Reply #4 on: February 21, 2007, 10:04:37 AM »

I found that using PHPmyadmin to dump (export) and load (import) my new database failed with:

'1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near for the right syntax to use near ' '

even though both the dump (which I checked in Notepad) and the import form were using UTF8.

The three spurious characters that cause the problem are "byte order marks" and you can only delete them with a suitable text editor as they are hidden in Notepad: I used the hex editor in PSpad, but I think Crimson Editor also allows this.

Also, you need to comment out or delete the first two statements (create database and use database) from the dump if you are importing tables into an existing database rather than using the SQL to create a new one (which is the case if using PHPmyadmin as described).

e.g.
-- CREATE DATABASE `server_-_db` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
-- USE server_-_db;

http://forum.mamboserver.com/showpost.php?p=331373&postcount=1

has some other handy tips for PHPmyadmin settings.
Logged
kane357
Full Member
***
Posts: 125


WWW
« Reply #5 on: June 28, 2007, 21:59:18 PM »

Error: The directory to store session data is not writable. Please correct this or contact your provider.


This is my delima i dont kno which directory this is
Logged

Joomla! 1.5.3
VM 1.1
Daz
Newbie
*
Posts: 44



WWW
« Reply #6 on: November 09, 2007, 18:54:21 PM »

Recently i move a site to a different domain name completely

Now this my not be the quickest way, but i did it the only way i could work out how with my limited skills and it worked first time!

1. Made a copy of my old site

2. Installed a FRESH copy of Joomla and VM in new location [MAKE SURE IT WORKS]

3. Uploaded images and templates from first site, to new site

4. Went through old database in PHP admin in my cpanel, found all relating elements to VM and Joomla i wanted across, i exported a copy of just those tables

5 in new install in new database, i dropped the tables of the files i want to replace

6 imported the database table i made in step 4

With changing the domain i had to go trhough a few products and change the url in the images, but apart from that, it worked pukka (there were 1100 products on the site)

Daz
Logged
rbc303
Newbie
*
Posts: 19


« Reply #7 on: November 19, 2008, 12:07:42 PM »

playing around in my site, and changed the site settings to www.mysite.com.

all my url's where coming up as www.mysite.comadministration :not found!

So see pic attached, very important to place the trailing forward slash in this spot. It should be www.mysite.com/


* slash.gif (7.85 KB, 609x205 - viewed 808 times.)
Logged
ultimatwing
Newbie
*
Posts: 1


« Reply #8 on: June 08, 2009, 21:45:03 PM »

Yes, very true rbc. Not only that, but it's proper format to always display a domain with a trailing slash / anyway, as url's without it are redirected to the /.
Logged

kkkjsam
Newbie
*
Posts: 1


« Reply #9 on: July 31, 2009, 12:33:52 PM »

i just got the same error..don't know how to solve it..




What Gay Quiz Character are you?


Logged
vmjunction
Jr. Member
**
Posts: 64


Virtue Planet Solutions


WWW
« Reply #10 on: July 31, 2009, 13:54:29 PM »

1) The joomla configuration.php;
2) The VM virtuemart.cfg.php; and

You just need configure the above two files to complete any site movement.
Logged

Super Administrator - www.VMJunction.com
Professional VirtueMart Themes
aldoswheel
Newbie
*
Posts: 1


WWW
« Reply #11 on: November 09, 2009, 01:44:45 AM »

Thanks for the helped Daz.
Logged

Pages: [1]   Go Up
Print
Jump to: