Moving a site form a localhost to a web host (names.co.uk)

Permalink
I have finally finished my first ever C5 site and would like to move my website from localhost to my web hosting service (names.co.uk)

I read various posts and guides on this topic but as I'm a total newcomer it might as well be in Greek!

I've been reading:
http://www.concrete5.org/documentation/installation/moving_a_site...
http://squirrelhosting.co.uk/hosting-blog/hosting-blog-info.php?id=...

The approaches are slightly different which adds to my confusion!

I think I've exported the sql file and set up the new database on my web host OK. However I'm stuck when I comes to moving the files!

Using headings from the documentation "Move a concrete5 site". The story so far...

Make A Database Copy:
I have exported a copy of my database using phpMyAdmin.

Get The Files:
I backed up my C5 site through dashboard and cleared the cache.
Deleted files/cache/, files/tmp/ and updates/

Stuck here!!!!!!!!:
"Do not delete the updates folder while your current site is still "live". If there is anything in it, the highest numbered version of concrete5 in that folder is the version your site is actually running. Your site's config/site.php will have a constant DIRNAME_APP_UPDATED defined that should match the name of the folder. Write that down.

To actually create your site archive, the easiest thing to do is to copy your entire public_html/ folder over to something like copied_site/ and then you can remove those three folders from copied site and create your archive. cPanel's File Manager lets you create an archive, and you can also do so from the command line with tar czfv site_copy.tgz copied_site/.

Now download the archive to your machine."

Move The Files:
Stuck here!!!!!!!!!
I've uploaded really basic static websites before using Panic's Transmit FTP software. I login and dump the files into the web/ folder. Hit sync and voila!. I'm I doing the same thing with my C5 site????

New database:
In the control panel of my web hosting service I have navigate to MySQL databases link. I click the button that says add database and create a new database with username and password.

In the same section of my control panel I then click the login link and get redirected to phpMyAdmin. I enter my username and password.

On the top left hand side there is the link to my data base. I click it and then click the import tab. I then choose the sql file I exported earlier and it appears to have uploaded!

Well thats it so far. Mainly hours of going around in circles!!!

If anyone can help guide me in simple steps I'd be eternally grateful!!!!

designclash1
 
jero replied on at Permalink Reply
jero
In essence, there are three things to do: Upload all files (except cache), create and restore your DB, update your site.php & .htaccess files. Seems like you've got the DB part sorted, if you're seeing a load of tables in PHPMyAdmin.

In your existing install, your "document root", you should see all these folders:

css
page_types
tools
blocks
elements
jobs
mail
updates
concrete
files
js
models
config
helpers
languages
single_pages
controllers
libraries
packages
themes

and also a file:
index.php

You may also have a file called
.htaccess - watch out it may be present but not show up on an FTP client unless you enabled "hidden files".

What you need to do is transfer all of those folders and files to the new host, lock stock and barrel. Everything. The whole lot.

Probably the easiest thing to do with your FTP client is to drag and drop the whole lot of them to their new home.

Having done that, on the host, go into files/cache and delete everything that's in there, leaving the cache folder empty. In fact, delete the cache folder - it should get recreated.

Next, go into the config folder, and download/edit the site.php file.

Change the lines

[code]
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'yourusername');
define('DB_PASSWORD', 'yourpassword');
define('DB_DATABASE', 'yourdatabasename');
[code]

so that they match the server, user, password and database that you created and restored your data to in PHPMyAdmin.

Upload/save config/site.php back to the same place, and you should be done.

A couple more gotchas.

1) If you look in config/site.php, you might have a definition for BASE_URL and/or DIR_REL. These need to reflect the domain name and path that you're now using. If you don't have them, you don't need them, so panic over.

2) If you enabled pretty URLs, then you're going to need a .htaccess file. You can either edit it to match, or probably the easiest thing is to delete it, and login (use index.php/login as the link to the login page since /login won't work) and then disable/enable pretty URLs in the dashboard. This should rewrite the file for you.

Good luck.