Moving Wolfcms from localhost to live server
- on 15/04/2014 (updated on 28/08/2014)
A lot of people on the forum asked this question so I took some time and made this tutorial. There are few ways to accomplish this and this is how I do it (and think it’s the best and easiest way)!
I will assume that you have your site finished and ready under your localhost (xampp, wamp, whatever…).
Step 1 – Compressing files
Go to your
htdocs/YOUR-PROJECT folder. It should look like image below.
Select all (Ctrl + A), right click and Compress or Zip (or whatever you use for compression).
You should get something like this:
Step 2 – Database Export
Now you need to login to phpmyadmin, select your database, click on Export (all default settings) and save your something.sql file somewhere on the hdd.
Step 3 – Into wilderness
Log into cPanel or Plesk or whatever your hosting provider uses.
Open File manager and go to the
/public_html/ folder – the root. Since I’m upgrading, mine looks like this:
Locate Upload button, click on it and find your
.tar.gz file and upload it.
Reload file manager (there is a button for it in cPanel) to see the file.
Uncompress/Extract uploaded file in to the root directory.
Step 4 – Database upload
Log in to phpmyadmin and select your database. If you don’t have any, you need to create one first.
If you are doing clean (first) move, skip to 4.2
Since I did an upgrade I have to delete my database tables first.
Droping the tables
Select your database from the sidebar and click Import button.
Click on the Browse button and locate your something.sql file.
Now click Go button. If everything went ok, you should see something like this:
Now let’s tweak other settings.
Step 5 – Tweaking
Locate config.php file. Change permissions to 777 or 755 (depends on your settings). Open the file with Code Editor and edit these lines:
Lines 9,10 and 11 – Define your credentials
// Database settings: define('DB_DSN', 'mysql:dbname=DATABASE_NAME;host=localhost;port=3306'); define('DB_USER', 'DATABASE_USER'); define('DB_PASS', 'DATABASE_PASSWORD');
Line 15 – do not show errors on a production site
Line 24 – Define your domain
Note: You might need to add www also.
Line 36 – Change path to administration
Note: Change “admin” to something else for better security.
Line 41 – Enable “Clean” URL’s
Save and close. Change permission back to 444 (or 644).
First you need to rename _.htaccess to .htaccess. Now open it with Code Editor and edit these lines:
Comment out lines 8 and 9 as you might get Error 500 – Inernal Server Error
#php_flag magic_quotes_gpc off ## Removed in php5.4 #AddDefaultCharset UTF-8
And edit RewriteBase on line 19:
If your site is in the root of your directory:
And if it’s in a folder or subdomain:
This should be it. Now check your site and see if it’s working!blog comments powered by Disqus