Move from dev to live server

Permalink 3 users found helpful
Hello. I apologize if someone already answered this but i can't seem to find it. Is there an easy way to push my site from my dev server (local windows xp machine running apache) to my live server (linux machine)? I am uploading the entire directory and backup/restore the database but I suspect there are settings that need to be changed. Anyone have a one, two, three approach to moving a site to another server?

Thanks!

karenalenore
 
Matt replied on at Permalink Reply
--- see the settings in config/site.php ---

1-Import your database to your new server.
2-Upload your public_html (htdocs) files to your new server. (if you want to: compress local then uncompress on server side using ssh or cPanel or similar)
3-Change the following code located in config/site.php to match your needs.

(usually 'localhost' doesn't need changing.)

<?php 
define('DB_SERVER','localhost');
define('DB_USERNAME', 'changeme');
define('DB_PASSWORD', 'changeme');
define('DB_DATABASE', 'changeme');
define('BASE_URL', 'http://changeme.com');
define('DIR_REL', '/concreteinstallfolderIfExsists');
define('PASSWORD_SALT', 'somecrazyalphanumericstringLeaveAlone');
?>


If you are installing concrete5 in to your root (public_html) directory, then use / as the DIR_REL

Hopefully that helps :)
It's really late so if this is neither correct or complete, please excuse. :) Someone can chime in to confirm though.
Matt replied on at Permalink Reply
in the previous post's code the base url should just behttp://changeme.com (without all <a href> stuff, it got bejangled somehow. :)
Matt replied on at Permalink Reply
--- see the settings in config/site.php ---

1-Import your database to your new server.
2-Upload your public_html (htdocs) files to your new server. (if you want to: compress local then uncompress on server side using ssh or cPanel or similar)
3-Change the following code located in config/site.php to match your needs.

(usually 'localhost' doesn't need changing.)

<?php 
define('DB_SERVER','localhost');
define('DB_USERNAME', 'changeme');
define('DB_PASSWORD', 'changeme');
define('DB_DATABASE', 'changeme');
define('BASE_URL', 'http://changeme.com');
define('DIR_REL','/concreteinstallfolderIfExsists');
define('PASSWORD_SALT','somecrazyalphanumericstringLeaveAlone');
?>


If you are installing concrete5 in to your root (public_html) directory, then use / as the DIR_REL

Hopefully that helps :)
It's really late so if this is neither correct or complete, please excuse. :) Someone can chime in to confirm though.
Matt replied on at Permalink Reply
...it keeps throwing in that extra stuff. hopefully you get the idea :)
karenalenore replied on at Permalink Reply
karenalenore
Thanks for your help with this - i'm getting the following error when i try to access the site. any ideas?


Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'fcaangel_concrete5.Packages' doesn't exist] in EXECUTE("select pkgID, pkgName, pkgIsInstalled, pkgDescription, pkgHandle, pkgDateInstalled from Packages order by pkgID asc") ' in /home5/fcaangel/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home5/fcaangel/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(918): adodb_throw('mysql', 'EXECUTE', 1146, 'Table 'fcaangel...', 'select pkgID, p...', false, Object(ADODB_mysql)) #1 /home5/fcaangel/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(893): ADOConnection->_Execute('select pkgID, p...', false) #2 /home5/fcaangel/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(645): ADOConnection->Execute('select pkgID, p...', false) #3 /home5/fcaangel/public_html/concrete/libraries/database.php(62): ADOConnection->Query('select pkgID, p...') #4 [internal function]: Database->__call(Array, Array) #5 /home5/fcaangel/public_ht in /home5/fcaangel/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

My site.php looks like this:


define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'fcaangel_fca');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'fcaangel_concrete5');
define('BASE_URL', 'http://66.147.240.162');
define('DIR_REL', '/');
define('PASSWORD_SALT', 'blahblahetc');


The domain isnt transfered yet, hence the IP. could that be my problem?
artisancreative replied on at Permalink Reply
artisancreative
I had to delete the Cache folders in Files to get it to work when I moved my site
buildingsomethingonline replied on at Permalink Reply
buildingsomethingonline
I had the EXCACT same error when I moved a clients site from my localhost to the actual server. Look in PHPmyadmin on your localhost and then again on your live server. You will notice one big really annoying difference. On your localhost (if your setup is the same as mine, wamp) all the table names are in lowercase. On the live server they have to be upper and lower (example: Packages instead of packages). I do not know the cause of the problem, but how I solved it for my client was to rename all the tables to upper and lower. The site is now functioning flawlessly.

If anyone else knows a quicker way to solve this problem please let me know but that is the surefire way that I found.
bluesun replied on at Permalink Reply
Hi There!

Just wanted to know what sql statement you executed to get this done. Or did you actually change the names on all the tables manually. I have the exact same problem .
Remo replied on at Permalink Reply
Remo
RENAME TABLE areagroupblocktypes TO AreaGroupBlockTypes;
RENAME TABLE areagroups TO AreaGroups;
RENAME TABLE areas TO Areas;
RENAME TABLE blockrelations TO BlockRelations;
RENAME TABLE blocks TO Blocks;
RENAME TABLE blocktypes TO BlockTypes;
RENAME TABLE btcontentfile TO btContentFile;
RENAME TABLE btcontentimage TO btContentImage; 
RENAME TABLE btcontentlocal TO btContentLocal;
RENAME TABLE btexternalform TO btExternalForm;
RENAME TABLE btfile TO btFile;
RENAME TABLE btflashcontent TO btFlashContent;
RENAME TABLE btform TO btForm;
RENAME TABLE btformanswers TO btFormAnswers;
RENAME TABLE btformanswerset TO btFormAnswerSet;


not sure if it's complete..
myregistration replied on at Permalink Reply
I have the same problem. I installed Concrete 5 in a subdirectory to test it out and decided to use it. I moved the file structure into the document root directory and changed the value for DIR_REL in config/site.php to '/'. This should have been easy, but I continue to get errors about files not being found and references to the OLD file paths. I assume it's was due to cache, but even when I renamed the cache folder and created new one I still get the errors. Maybe there's a cache for previous database query results? I've searched the database and text files for the name of the old directory but no occurences. I'm stumped, any ideas? Thanks!
tcsllc replied on at Permalink Reply
tcsllc
I'm having the same issue... What is needed to move from a \test dir to a \ dir?
tcsllc replied on at Permalink Reply
tcsllc
I tried what you suggested and my site comes up but the links all point to the old site, I can't sign in, the link sayshttp://index.php/login. Anything else I need to change?
JCinch replied on at Permalink Reply
To move concrete5 from a test directory to root, or vice versa, you must first move ALL concrete5 files that you are working on in the folder that you want, then, to check that it worked, go to your website where you put it. It should display a 404 error message. Don't worry, it's normal. Then, open config/site.php in notepad, or some text editor you like, or even in your administration panel for your website and remove the code:
(This code will ONLY work if you are moving it to the root:
define('DIR_REL'yourdirectory '');


... and replace it with:

define('DIR_REL'/ '');


And, if you are moving it to another directory, replace the forward slash after: define('DIR_REL' :with your sub directory, excludinghttp://www.yourdomain.com. eg. If you were putting it inwww.www.yourdomain.com/test/concrete5... then you would replace the forward slash with /test/concrete5 .

Hope it helps,
fikelfikel
AltaPlanning replied on at Permalink Reply
AltaPlanning
I beat my brain over this one for far too long today... moving my dev site to a live site from primary.com/addon/ to addon.com

The configuration that finally worked (flawlessly) for me was:


define('BASE_URL', 'http://www.addon.com');
define('DIR_REL', '');


as in no / is the DIR_REL line.

Anyone visiting the naked domain (addon.com) will automatically redirect tohttp://www.addon.com
zenfu replied on at Permalink Reply
This one (getting rid of the "/") worked for me. Does that mean something else is configured wrong?
hac replied on at Permalink Reply
hac
You need to clear your cache in the Debug tab of Sitewide Settings in your Dashboard.
invision replied on at Permalink Reply
invision
I had to change the
define('DIR_REL', '/');

setting to
define('DIR_REL', '');

to get my moved c5 site to work.
edward replied on at Permalink Reply
Remo, thanks! I've adjusted your SQL to include all the tables in my (5.3.3.1) installation.

ALTER TABLE areagroupblocktypes RENAME _areagroupblocktypes;
ALTER TABLE areagroups RENAME _AreaGroups;
ALTER TABLE areas RENAME _Areas;
ALTER TABLE ataddress RENAME _ataddress;
ALTER TABLE atboolean RENAME _atboolean;
ALTER TABLE atbooleansettings RENAME _atbooleansettings;
ALTER TABLE atdatetime RENAME _atdatetime;
ALTER TABLE atdatetimesettings RENAME _atdatetimesettings;
ALTER TABLE atdefault RENAME _atdefault;
ALTER TABLE atfile RENAME _atfile;
ALTER TABLE atnumber RENAME _atnumber;
ALTER TABLE atselectoptions RENAME _atselectoptions;
ALTER TABLE atselectoptionsselected RENAME _atselectoptionsselected;
ALTER TABLE atselectsettings RENAME _atselectsettings;
ALTER TABLE attributekeycategories RENAME _attributekeycategories;


This SQL code works for me on my Windows box; without the additional rename to "_{$table}" MySQL wouldn't do a rename at all.

You probably have to add "lower_case_table_names=2" to the [mysqld] section of your my.ini first, though - as suggested below. And don't forget to restart your MySQL-server :)
wendysandsheds replied on at Permalink Reply
If you have installed onto your local dev sever using Wamp, then try the following. It corrects the naming of the tables in the database.

Left-click the wamp gauge, then select Apache → Apache Modules → Rewrite Module. The gauge will flick to yellow, and then return to white.

Left-click the gauge, then select MySQL → my.ini. At the very bottom of the file, and add the following to a new line (without the quotes): “lower_case_table_names = 2”. Save the file, close Notepad and left-click the gauge, and selected ‘Restart all services’
johndorsay replied on at Permalink Reply
johndorsay
I've just spent too long moving a site from dev to live, so here is the way to do it. No really!!!!

Copy all files to the new server,
Copy the database over (Navicat, phpMyadmin)
Delete everything in the cache folder, THEN MAKE SURE IT IS CHMOD 777

Then update your config/site.php file (if the c5 install is at the root)
<code>
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'username');
define('DB_PASSWORD', 'password');
define('DB_DATABASE', 'databasename');
define('BASE_URL', 'http://www.domain.ca');
define('DIR_REL', '');
define('PASSWORD_SALT', 'Ezbx1Q0tJfyAcXCUTi4LYDoNHn5Kej8mvG9SWZhskMulFp3a7I62rgqBwPRVO');</code>

Then make sure you clear your cookies

This is finally what worked for me.
C5 rules !!!!
nivle replied on at Permalink Reply
hi!

I've already entered the right configuration but when I view the site, it shows only white page or blank.

Why is that happening? what is the solution?

Thanks
-vin
daniela replied on at Permalink Reply
daniela
If you have pretty urls turned on, you gotta edit the .htaccess file to change the rewrite rule base. So in this example, if the site was originally set up in the /c5 off the site root, .htaccess would have this:
RewriteBase /c5/

which would need to change to:
RewriteBase /

or, of course, vice versa if you're moving from the site root to a subdirectory. Or you could just turn off pretty urls then turn them on again & cut and paste the revised text for your .htaccess file.
xsastre replied on at Permalink Reply
After serveral problems trying to move from one server to another (from one Linux to another), I got it work!
Just in case it helps, I'll explain briefly the steps I followed:
1.- Concrete full DB Backup (I did it from phpMyAdmin)
2.- Copy all concrete dir structure with all files
3.- Restore DB in the new server (creating a new schema if necessary)
4.- Restore all files and directories of Concrete in the new File System.
5.- Change owner of concrete file structure. Owner should be the same that runs Apache(ie. www, www-data, etc.)
6.- Change group accordingly to step 5.
7.- Finally modify config/site.php in order to specify all new parameters. (In my case I changed all of them, except for DB_DATABASE as I restored the DB creating the same schema as the original).

An with this, it worked. I hope for you too!
petertan77 replied on at Permalink Reply
I'm new to Concrete. I tried moving from test to root dir and changed the site.php. Initially the home page worked when I tried the other pages, it gave me this error:
mysql error: [-32000: Cache write error]. I went back to the test dir and clear the cache and now I get this error from root home page:

Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [-32000: Cache write error] in CacheExecute(/var/www/html/docs/server.com/files/cache/05/adodb_055c9a641e111c50d1caaf6b29c64685.cache, select ctID from PageTypes) ' in /var/www/html/docs/server.com/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /var/www/html/docs/server.com/concrete/libraries/3rdparty/adodb/adodb.inc.php(1819): adodb_throw('mysql', 'CacheExecute', -32000, 'Cache write err...', '/var/www/html/d...', 'select ctID fro...', Object(ADODB_mysql)) #1 /var/www/html/docs/server.com/concrete/libraries/database.php(34): ADOConnection->CacheExecute(10, 'select ctID fro...') #2 /var/www/html/docs/server.com/concrete/models/permissions.php(461): Database->querycache(10, 'select ctID fro...') #3 /var/www/html/docs/server.com/concrete/models/permissions.php(72): CollectionPermissions->CollectionPermissions(Object(Page)) #4 /var/www/html/docs/server.com/concrete/models/permissions.php(116): PermissionsProxy:: in /var/www/html/docs/server.com/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php on line 78

Appreciate some help. Thanks.
clairec replied on at Permalink Reply
clairec
Did you solve this? normally I have no problems with my own server as I'm working on another providers server I now have this issue. If you solved it could you post to how you did

Thankyou
petertan77 replied on at Permalink Reply
I didn't get it to work by moving the test to root directory. I changed the virtual domain root (httpd) path to the test dir.

No answer to date from the forum or anyone. Good luck!
nteaviation replied on at Permalink Reply
nteaviation
I am having the same issue when trying to copy from 1 directory to another. I have tried all the above procedures, but I still get in my browser "Internet Explorer cannot display the webpage" and an "[apc-error] Cannot redeclare class object" entry in my log/httpd/error_log. Thanks in advance!
nteaviation replied on at Permalink Reply
nteaviation
I got it to work finally. I cleared the cache using the concrete debug tool. Copyied my database to a new one using phpMyAdmin. Copied all my files to a new directory using "cp -rp c5 c5new". Edited my config/site.php. Here is the kicker, I then had to restart my apache server. That one mystifies me, but I guess php needed to be reset for some reason.
jasjoneswa replied on at Permalink Reply
.htaccess needs to be changed in order for permalinks to be properly used.

# -- concrete5 urls start --
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /NEWDIRNAME/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
# -- concrete5 urls end --
theartist replied on at Permalink Reply
Hi all

First post here but I found this thread really helpful. I just moved my site from Dev to live and had to do all the config/site.php changes mentioned in this thread. These are straight forward so I won't go over them again, but I DID need to change ALL my database table names from lowercase to uppercase (yikes! all 111 of them)...but everything now works beautifully...

So to save anyone else the trouble here is the SQL I used that you can put into phpMyAdmin (I'm using concrete 5.4.0.5).

RENAME TABLE areagroupblocktypes TO AreaGroupBlockTypes ;
RENAME TABLE areagroups   TO    AreaGroups   ;
RENAME TABLE areas   TO    Areas   ;
RENAME TABLE ataddress   TO    atAddress   ;
RENAME TABLE ataddresscustomcountries   TO    atAddressCustomCountries   ;
RENAME TABLE ataddresssettings   TO    atAddressSettings   ;
RENAME TABLE atboolean   TO    atBoolean   ;
RENAME TABLE atbooleansettings   TO    atBooleanSettings   ;
RENAME TABLE atdatetime   TO    atDateTime   ;
RENAME TABLE atdatetimesettings   TO    atDateTimeSettings   ;
RENAME TABLE atdefault   TO    atDefault   ;
RENAME TABLE atfile   TO    atFile   ;
RENAME TABLE atnumber   TO    atNumber   ;
RENAME TABLE atselectoptions   TO    atSelectOptions   ;
RENAME TABLE atselectoptionsselected   TO    atSelectOptionsSelected   ;


Good luck anyway if you're having problems like I had! Next time I think I'll do all development directly on the live server, just in a Test folder and change the config/site.php afterwards when I move it to the root (much easier!)
Nikolaj7 replied on at Permalink Reply
We have just tried to move a concrete5 site from an old server to a new server and adjusted site.php accordingly.

Further the old path on the old server was:

/www/sitename/

Path on the new server is:

/usr/home/wwwhomes/sitename/

When loading the front page we get:


display($c);?>
display($c); ?>
display($c); ?>


We are able to access the backend allright.

Any suggestions to make this work?

Thanks.
Mnkras replied on at Permalink Reply
Mnkras
#1 really old thread

#2 did you follow the following guide:http://www.concrete5.org/documentation/installation/moving_a_site...
jordanlev replied on at Permalink Reply
jordanlev
You may be using php short tags (like "<?=" instead of "<?php") in your page type templates, but have short tags disabled on your server.
If this is the case, then you need to either change this setting in the php.ini file on your server, or change your page type templates to use normal php tags ("<?php" instead of "<?=").
jordanlev replied on at Permalink Reply
jordanlev
This is probably because you developed on a Windows machine and then installed on a linux server.

To prevent this from happening in the future, you want to add this line to your mysql config file ("my.ini"):
lower_case_table_names=2


That only helps if you do it before creating a new database, though -- so if you've already created it then yes you need to run a query like the one you have there. Someone wrote a script for this a while back as well
-- sorry you had to recreate this all on your own :(

http://www.concrete5.org/community/forums/installation/move-site/#2...

http://www.concrete5.org/community/forums/installation/uncaught_exc...
Nikolaj7 replied on at Permalink Reply
Hi,

Setting "short_open_tag = On" in php.ini solved this.

Thanks for the answers.

Regards,
Nikolaj
mixedpixel replied on at Permalink Reply
mixedpixel
If you have any problems after moving your site and have to use "RENAME TABLE smallcases TO upperCases" check this add-on:
http://www.concrete5.org/index.php?cID=97513...

how it works:
http://www.concrete5.org/files/1112/9040/0018/MySQLCaseInsensitiveH...
intrax replied on at Permalink Reply
SPAM ! Free scripts available...
robic replied on at Permalink Reply
robic
hey guys ,

i have untested idea about moving concrete5 site from development server to production server but its simple and easy to do for everyone:

You should:
create a backup sql file through "System & Maintenance" -> "Backup & Restore" -> "Run Backup" on you local/development server.

step 1:
create a fresh mysql database on you live server.

step 2:
download concrete5 installation package from c5 download section into production server.

step 3:
unzip it wherever you want in live/production server. ( off course in public_html or every directory that should be your servers root http dir.)

step 4:
browse the location/domain/ip your extracted c5 package , from you browser.

like :http://your-address-domain-or-ip/c5-dir/...

step 5:
follow installation instruction and enter database information and ...

step 6:
login into you new installation

step 7:
goto "System & Maintenance" -> "Backup & Restore" -> "Run Backup" on you new installation on production server.
this will create a folder named "backups" on "file" folder in c5 root directory.

step 8:
upload your database sql file you created on your local/development server to "files/backups" on production server and give it right permissions for web server access.

step 9:

goto "System & Maintenance" -> "Backup & Restore" -> and restore sql file you uploaded ( not sql file created on step 7 ).

step 10:
upload/Synchronize local folder with production one i suggest you do it manually
and upload any directory to their location in production server ( not c5 main files , just files and folders you created on local machine installation) .

step 11 : almost finished , enjoy.

RoBiC
jordanlev replied on at Permalink Reply
jordanlev
I have a similar method, although with a few modifications to your list:

* You'll want to clear the cache via the dashboard on your local system before backing up the database.

* I wouldn't bother with steps 4-9. Instead, just create the database on your server via PHPMyAdmin and import the backup sql file directly there.

* I would add a little more detail to step 10:

~You'll want to remove the "cache" directory from inside your "files" directory before copying that up to the server (also "tmp" and "trash", although they're usually empty). Depending on how many files you have, it may be best to ZIP this directory and UNZIP it on the server (but this requires SSH access or futzing with CPanel, which I've found is not worth the trouble for non-programmers).

~Generally you should only need to copy "blocks", "config", "files", "packages", and "themes" (although if you have made more complex customizations to your site, there could be others).

~After copying up to server, modify config/site.php and change BASE_PATH, DIR_REL, and the database connection info. Even if you don't do this step (and you just use the config file that was created by a fresh C5 install), at the very least you'll want to copy the PASSWORD_SALT value from your local machine up to the server's config/site.php file -- otherwise you won't be able to log in!

~If you had pretty url's turned on in your local machine, edit the RewriteBase value in the .htaccess file on the server.

* Once you're done, make sure you test out the site -- navigate to different pages while not being logged in.

* Log in, go to the dashboard, do the following:

~Re-index site for search and sitemap.xml (Dashboard -> System & Maintenance -> Run Checked)

~Enable Production Mode (Dashboard -> Sitewide Settings -> Debug)

~Go to Dashboard -> Sitewide Settings -> General, and set the desired cache level (in Speed Settings), turn on Pretty URL's if desired, and paste in Google Analytics code if desired. And don't forget a favicon!
MrNiceGaius replied on at Permalink Reply
MrNiceGaius
Viewing your site before the domain name DNS stuff resolves requires the use of a preview url in the format of
http://xxx.xxx.xxx.xx/~username/


There is a simple trick to getting the C5 config file setup in order to view the site with the above preview url format.
//in config/site.php
define('BASE_URL', 'http://xxx.xxx.xxx.xx');
define('DIR_REL', '/~username');

I just found this out today when being frustrated by a 'page not found' error just to realize that my URL needed a second backslash at the end for C5 to detect 'root' level e.g. 'http://xxx.xxx.xxx.xx/~username//'.
By dropping the last backslash "/" from the DIR_REL setting C5 properly resolves to the root folder. Yea, it works :) Hope this helps.