Page 1 of 1

[SOLVED] Instructions for moving to new location -

Posted: Mon Apr 20, 2009 4:08 am
by susiegb
I've been working on my first CMS MS site locally - using MAMP. But because I've come up with a problem I need someone else's eyes to look at I'm going to upload it to a test folder on my main website.

So, I've never uploaded a CMS to a server before. Are the instructions in the documentation, for moving a site to a new location the ones I should follow?

thanks
susie

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Mon Apr 20, 2009 4:55 am
by zark
Hi Susie,
You can find the info you need here: http://wiki.cmsmadesimple.org/index.php/How_to#How_to_move_your_CMSms_installation_to_a_new_server_.281.29

If you are not sure about the paths to change in config.php, you can install a fresh copy on the new server first, (same version of cmsmadesimple), then carry on with the instructions, but making sure you do not overwrite the config.php in the root or admin directories on the new server.

Re: Instructions for moving to new location - do these apply when moving from lo

Posted: Mon Apr 20, 2009 6:29 am
by Dr.CSS
Yes susiegb they are the same, best bet is if you run into trouble with the site working...

Run install, if you need to do this then find the original install folder from your unpacked ver. of CMS Made Simple and upload it...

Now here is "important part" DON'T CREATE TABLES OR INSTALL DEFAULT CONTENT in step five where you add the info for the DB and this will correct any path problems you may have and keep all the hard work you've done to get your site to this point...

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Tue Apr 21, 2009 1:52 am
by susiegb
Thanks for that. I'll have a go in the next 2-3 days (evenings) and let you know how I go ... :)

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sat Apr 25, 2009 3:19 am
by susiegb
Hi there - back again and of course I'm having problems ... :)
I did the 'move to a new server' option and made what changes I could work out to the config.php file. I uploaded it all into a new folder called 'cms' on my website. But when I tried to open the site  http://www.greendoorwebsites.com/cms/ - I got this error msg:
Database Connection Failed
Error: Unknown MySQL server host 'greendoorwebsites.com/cms' (1) (2005)
Function Performed: CONNECT
Host/DB: greendoorwebsites.com/cms/hcg
Database Type: mysql
I could copy the config.php file here if that would help. Alternatively, if I followed Mark's suggestion and re-installed -
mark wrote: ...

Run install, if you need to do this then find the original install folder from your unpacked ver. of CMS Made Simple and upload it...

Now here is "important part" DON'T CREATE TABLES OR INSTALL DEFAULT CONTENT in step five where you add the info for the DB and this will correct any path problems you may have and keep all the hard work you've done to get your site to this point...
Not quite clear on a couple of things about this:

1. Are you saying I should unzip the original installation, and then just upload the original install folder, and upload that? Would that actual insstall CMS MS in my 'cms' folder?

2. Re not craeting tables or installing default content: how does the real content get up there? Will it just be the hcg database from my local version in MAMP that I upload (as I have already)?

Sorry to sound dumb - but this side of web development is a complete mystery to me at the moment! I'm sure I'll get there eventually ... :)

thanks
- susie

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sat Apr 25, 2009 4:41 am
by jmcgin51
susiegb wrote:
Database Connection Failed
Error: Unknown MySQL server host 'greendoorwebsites.com/cms' (1) (2005)
Function Performed: CONNECT
Host/DB: greendoorwebsites.com/cms/hcg
Database Type: mysql
you need to find out your mysql db server info (ip address usually) from your host.
susiegb wrote: 2. Re not craeting tables or installing default content: how does the real content get up there? Will it just be the hcg database from my local version in MAMP that I upload (as I have already)?
The "real" content will come from the database backup (from your MAMP install) that you restore into the live database provided by your host.  (see comment above about getting the info from your host)

Re: Instructions for moving to new location - do these apply when moving from lo

Posted: Sat Apr 25, 2009 5:15 am
by Dr.CSS
To move:

Transfer all files from one to the other, add the install folder from the ver. you are using, if the moved site is 1.5.1 then use an install folder from 1.5.1, if 1.5.3 use the install folder from that, you get the idea...

Most times you will download the tar file from http://dev.cmsmadesimple.org/project/files/6#package-1 and unpack them on your comp. then FTP them to your site, or get them up there some how, so you should still have the unpacked folder on your comp. including the install folder, I still have the first one I used from march of 2006... ;)

Once all folders/files are transfered to new site move your DB, this will be done in many diff. ways as your setup may not be the same as mine but basically it is go to your control panel, mine is cPanel then...
I go to MySQL Databases that has a link to create a DB...
Where you need to create a new DB and then I add a user to it that has all privileges...
Then at the bottom it has a link to phpMyAdmin where I can now import the DB into the new DB I just made...

Now you go to your site, yoursite.com/install/ and this will start the install process fill all needed fields and keep going till you get to step 5...

Here it asks for Site Name, do as you need here, and then it asks for Database Information here you fill in the needed info...

Database Type:  most are mysql
Database host address:  on mine it is localhost, but it looks like yours is something you don't know or got wrong some how, my 1and1 used to be something like db1092.perfora.net
Database name  this is where you use the name you made for the DB in the MySQL Databases step
Username          name that you used in the MySQL Databases step
Password           the one you made in the MySQL Databases step
Database port     I never use this
Table prefix        If moving a site you need to use the same one you used the first time, most times this is cms_

Next is the part you want to be careful of if you don't uncheck this you will get a default install and all you changes will be removed..
Create Tables (Warning: Deletes existing data)  UNCHECK THIS
Install sample content and templates    UNCHECK THIS if you don't it will mess up your work..

Proceed from here as normal install, and this should fix any path problems you may have when moving a site...

susiegb:

Your problem is that you can't connect to the DB you have the wrong path to the DB host, you may need to cantact your host to find the correct path and if the other settings are correct like username and password you should be good to go when you change the path in your config.php...


EDIT: sorry if I wasn't clear about having to create the DB before you can import one to it...

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sat Apr 25, 2009 12:31 pm
by susiegb
OK - it's late at night here and I'm going to do it tomorrow, but just one more question on databases. So, I have to create one in my CPanel do I? (I've looked at it, and that seems to be the only option) Would I give it the same name as the one I've set up locally? And then import that database into the new one?

On another note, I removed the reference to localhost in my config.php file - I thought that related to me having been working on a local server! Sounds like that was wrong ... ?!

Thanks for your patience here ... And do I really have to go through all of this again when I upload the site to its 'final location' I wonder? As I'm hosting the site, maybe not so much, but I guess I'll cross that bridge when i come to it!

cheers
susie

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sun Apr 26, 2009 5:01 am
by susiegb
Hi again

Still having problems. I followed your suggestions - copied the install folder into my cms folder (inside the folder with all the cms files). Then I went to the MySQL databases section of my CPanel, and created a user. Then I tried to import the cms database which I'd exported from MAMP (via phpMyAdmin). I tried in all different formats but keep getting this error msg:

Error

SQL query:

--
-- Database: `hcg`
--
-- --------------------------------------------------------
--
-- Table structure for table `cms_additional_htmlblob_users`
--
CREATE TABLE `cms_additional_htmlblob_users` (
`additional_htmlblob_users_id` int( 11 ) NOT NULL ,
`user_id` int( 11 ) default NULL ,
`htmlblob_id` int( 11 ) default NULL ,
PRIMARY KEY ( `additional_htmlblob_users_id` )
) ENGINE = MYISAM DEFAULT CHARSET = latin1;

MySQL said: Documentation
#1046 - No database selected


Can anyone see what I'm doing wrong?

TIA

- susie

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sun Apr 26, 2009 1:16 pm
by jmcgin51
susie - please confirm that you have done the following:

1. Created a MySQL database on your host's db server, and assigned a user for that db.  Make sure this user has all permissions.  The database name does NOT have to match the name of your local development db.  For example, on my local machine, I only have one db set up, and I run several sites through it simultaneously (with distinct table prefixes for each site).  When I need to copy to a live server, I export the required tables, then upload to the proper database.

2. Changed the db connection settings in your config.php file to match the db settings used for the db on the host.
  (localhost refers to a "local" machine, but in this case "local" doesn't mean the machine is necessarily sitting on your kitchen table.  localhost is often a valid selection when working with *nix servers.)  Regardless, you need to use the settings provided by your host.  In cPanel, you can find the correct db server address on the "MySQL Databases" page, under "Access Hosts".

3. Uploaded the new/correct config.php file to the host's webserver.  (an easy step to forget)

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Sun Apr 26, 2009 10:33 pm
by susiegb
Ah ... no I haven't! Thank you for clarifying what I should have done. I will do that this evening and report back!

I didn't realise I had to create a new MySQL database on the db server. I did create a new user, but that was all. What you said about your setup on your local machine - that in fact is what I was doing/aiming to do with MAMP on my local machine. I hadn't thought this through to replicate on the host server.

In fact I hadn't done any of these steps! Thank you so much for this. I'm getting together documentation of all the steps I have to take for future CMSs ! Hopefully once I've done this I may be successful, but we shall see! At least I'm learning lots here!

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Tue Apr 28, 2009 4:14 am
by susiegb
Well, thank you everyone! I have now uploaded it successfully, and it's there! And I've documented everything that different people told me to do here which has helped me, for the next time - thank you.

I did get various smarty errors during the setup phase, but it still all went through successfully. At one point with the smarty errors it said to have a look at the Troubleshooting page in the documentation. I did but couldn't see anything relevant. Should I be concerned about this errors?

I have noticed that some of the css layout styles aren't working properly/haven't been picked up. I don't know if that could be anything to do with the said smarty errors - or probably more likely stuff I need to fix up either in my code, or in the implementation. There are definitely errors of mine in there that I need to fix - that's one reason I wanted to set up a test site.

But if anyone thinks the smarty errors (and of course I have no idea what they were now!) might have affected my CSS code and I should perhaps try and re-install or something, please let me know.

Otherwise I'll carry on trying to fix it up, and will close this topic ...

Thank you everyone yet again!

Re: Instructions for moving to new location - do these apply when moving from local

Posted: Tue Apr 28, 2009 1:42 pm
by jmcgin51
susie - glad you got everything up and (mostly) working.  Without knowing more about your specific errors, it will be impossible to troubleshoot.  You could try running the install again and see if the errors appear, and write them down if they do.

Otherwise, if you're satisfied that this thread is solved, please add [SOLVED] to the subject line so that others will know it no longer needs attention.  Thanks!