Moving from Wampserver2.oi to Ubuntu VPS with Webmin-Virtualmin -Success

Permalink 1 user found helpful
Moving from Wampserver2.oi to Ubuntu VPS with Webmin-Virtualmin -Success

Concrete5 Transfer from local WindowsXPpro Wampserver2.0i to Ubuntu VPS with Virtualmin and Webmin
(There are many ways to accomplish this. This is just one person's way which eventually worked.)

Process that leading to this document:http://www.concrete5.org/community/forums/chat/wampserver-to-vps-in...
Mnkras Moving a Site http://www.concrete5.org/documentation/installation/moving_a_site...



1. PREPARE YOUR VPS - Make sure you have a VPS domain, and have created a username and password, and created a new Mysql Database called "concrete" and that you have access to the database "concrete" with a username and password. See notes in above for this.)


2. CHANGE CONCRETE DB TABLE NAME CAPITALIZATION -

A. Wampserver creates table names in all lowercase which will not be accepted when you backup and restore the 'concrete' Database to your VPS. If you do not change the table names to mixed caps for each word in the table, you will get an error similar to:
"Fatal error: Uncaught exception 'ADODB_Exception' with message 'mysql error: [1146: Table 'avenus_conrete.Config' doesn't exist] in EXECUTE("select cfValue from Config where cfKey = 'PERMISSIONS_MODEL'") ' in /home/avenus/domains/mydomain.pl/public_html/concrete/libraries/3rdparty/adodb/adodb-exceptions.inc.php:78 Stack trace: #0 /home/avenus/domains/mydomain.pl/public_html/concrete/libraries/3rdparty/adodb/adodb.inc.php(918..."
So please change your table name capitalization by reading this post

B. By looking at Concrete db in Wampserver phpAdmin, it can be seen that the tables are entirely in lowercase, these must be changed to capitalize the words in the table name before backing up and transfering the database to the VPS. This can be done within the Wampserver phpAdmin by cut and pasting the text file of sql commands in "ReNameC5Tables-C5411.txt" This file has commands for Gallery, NextPrevious, SortableFancyboxGallery, Superfish, DateNav etc. and is for Concrete 5.4.1.1

C. Also please refer to this forum post: "Move Wampserver 2.0 Windows to VPS with Webmin/Virtualmin - Table Capitalization" http://www.concrete5.org/index.php?cID=110504.... Use the last version of the file ReNameC5Tables-CR411.txt.
andhttp://www.concrete5.org/marketplace/addons/mysql-case-insensitive-...

D. To execute the SQL commands to change capitalization of the tables. Left click on the Wampserver quickbar icon, pick phpadmin, First backup your concrete db!!, then pick SQL, pick concrete Database, then cut and paste the SQL commands from this file and pick "go" to execute the sql and capitalize the table names. Then inspect for other tables that have not been capitalized and use same format but make your own command.

E. From my pc wampserver on the 'localhost', inside the dashboard, I then updated the indexes, etc. cleared the cache, then backed up the database several times.

F. Refer to this forum post "Move Site" which gave me courage and vital information, see note at the end Sept 26,2010 written by 'grosbedo' "Move Site" has an attachment that I used and updated called "renameC5tables.sql".
http://www.concrete5.org/community/forums/installation/move-site/#2...

G. See why this is necessary. MySQL Case Insensitive Hell for C5http://www.concrete5.org/marketplace/addons/mysql-case-insensitive-...

H. Note that there is an addon for $15 which will properly capitalize your Concrete DB table names. You can download it and run it if the above is too complicated.


3. CLEAR CACHE & BACKUP - First when logged into your Local Wampserver Concrete5 website:
A. from the Dashboard > System & Maintenance > Jobs > Installed Jobs - Check all, then Run Checked
B. from the Dashboard > Sitewide Settings > General -Under Clear Cache click Clear Cache the set Full Page Caching to Disabled
C. from the Dashboard > System & Maintenance > Backup & Restore - Run several backups.

4. USE PHPadmin to BACKUP -Also just to be sure, make a backup of the Concrete DB from within PHPadmin. With Wampserver running, click on the Wampserver quickicon and pick phpAdmin. Click "Export". Select "Concrete" db by highlighting it in the box, make sure it says "SQL", check "Save as file", type in a name like Concrete_date, and save to My Documents, then move it to "c:/wamp/www/files/backup".

5. DOWNLOAD CONCRETE UPDATE -Note now may be a good time to update your version of Concrete, but only if there is a newer version, by downloading it. If you are not careful however, it may be better to get it running on the VPS first, then update. What I did was download the most recent version Concrete5.4.1.1 and unzipped it into a directory (EG: "My Documents / Concrete5.4.1.1"), and then copied my own upper level user/site-particular files into the new setupsuch as:
c:/wamp/www/files/ --Photos, files & other File Manager files you've created.
c:/wamp/www/files/backup/ --Concrete Database backup files that you backed up.
c:/wamp/www/jobs/
C:/wamp/www/packages/ --Addons -gallery, sortable_fancybox_gallery, superfish, etc.
c:/wamp/www/single_pages/
c:/wamp/www/themes/ --Site particular theme, for example Plain Vanilla copied as SHYCCruise
c:/wamp/www/config/ --contains site.php file, to be changed for the VPS setup
Above copied into the corresponding new upper level empty folders that you just unzipped (EG: "My Documents/Concrete5.4.1.1/concrete/<see the empty folders that are here>.

6. SITE.PHP CHANGES -Regarding d:/wamp/www/config/ I've created two secondary files siteWamp.php and siteVirtualmin.php each one configured for the appropriate platform (local windows wampserver or VPS) to ease this task later. These files once completed would be copied into your new configuration folder too. Then copy siteVirtualmin.php over site.php in the new configuration folder.

siteWamp.php - For Local Windows Wampserver setup (fill in items between < >)
--------------
[<?php ]
define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '<yourlocalpassword>');
define('DB_DATABASE', 'concrete');
define('BASE_URL', 'http://localhost');
define('DIR_REL', '');
define('PASSWORD_SALT', '<put the encrypted code that is unique for your Concrete5 installation here.>');


siteVirtualmin.php - For VPS setup
-------------------
[<?php ]
define('DB_SERVER', 'localhost');
define('DB_USERNAME', '<yourusername>');
define('DB_PASSWORD', "<yourpassword>');
define('DB_DATABASE', 'concrete');
define('BASE_URL', 'http://yourdomain.com');
define('DIR_REL', '');
define('PASSWORD_SALT', '<put the encrypted code that is unique for your Concrete5 installation here.>');


site.php
--------
Copy the appropriate file from above to this file location. If you are uploading to VPS copy "siteVirtualmin.php over site.php

7. FIX VERSIONING - (if you changed it for Wampserver) See notes above. The changes made to get versioning working have to be undone.
In C:\wamp\www\concrete\libraries\3rdparty I copied the htmldiff directory to the new folder so I would have it available if I move the site back to wamp even though it will be unused.
Also there are some file changes needed. But I do need to reverse the changes made earlier to
/concrete/config/base.php. I copied baseVirtualmin.php and baseWamp.php from c:/wamp/www/concrete/config to the corresponding folder in my new setup. Then I made sure that base.php was as set up originally for concrete on a VPS.
See notes above modifying line 331.

8. FIX SAFE MODE - See notes above. On your server Safe Mode has to be set properly in Webmin > Services > PHP5.

9. DELETE CACHE FILES -One last thing to do is to delete all files under "files/cache/". I found about 1400 files and 34 mb. This takes up space while creating the Zip file and takes time uploading to your VPS.

10. ZIP CONCRETE IN PREPARATIN FOR FTP
Then Zip the Concrete5 websites entire file system in your configuration (Zip all the Concrete files and directories). As Phil "thephilm" suggests, "zip the local folder (note - don't zip the folder, zip all the files and subfolder, otherwise it will try to create that folder on your server)." The folders are:
blocks
concrete
config
controllers
css
elements
flash
helpers
images
jobs
js
languages
libraries
mail
models
packages
single_pages
themes
tools
updates
plus various files
I had to split these up into smaller ZIP files. First I did all directories except the 'files' directory as one ZIP of about 10m. Then I split up the 'files' directory into two ZIP files of about 20m-50m. I found 'Jzip' was free and worked the best for me. Pay attention to locations! Setup your ZIP file to unzip properly into folders at the proper level just below public_html.


11. UPLOAD ZIPPED FILE TO THE VPS
Then Upload the Zipped file to the new server using an ftp program. I used Filezilla, because Cuteftp had too many errors. Upload the zip file to your public_html folder (under home/domain/public_html/). These ZIP files were under 50mb, and it took a number of trys to get them all up on the website without errors (kept uploading short on size). The files directory kept coming up short in size when I was uploading. These ZIP files were under 50mb, and it took a number of trys to get them all up on the website without errors (kept coming up short on size). (Note I first tried to FTP the huge number of files without zipping, it was impossible to do without errors and took days!)


12. UNZIP UPLOADED FILEs INTO THE VPS public_html FOLDER
Then unzip the files you upload onto your server. As Phil "thephilm" says:
A. SSH into your server, by downloading Putty and using your user and pass to login to your site. Use the user of the virtual server as the user / pass. This will help with permissions!
B. Navigate to the folder - typically just "cd public_html" as you should be in your home directory.
once there you can use the command "ls" to see what files are there. Likely will just be the zip file.
C. To unzip just use the command "unzip filename.zip"
D.. type "ls" again to verify all the files / folder structure is correct. Note - it should take almost no time at all to upload the single zip file, while it can take hours to upload all the small files in a Concrete5 install.


13. CREATE THE CONCRETE Database from within Virtualmin, while logged in as 'root' on the main website, select your Concrete5 domain in the dropdown. Then pick Edit Database, The select create a new database. Name it Concrete. Assign the database to your Concrete domain name and make a new email, login and assign it FTP and DB access to the Concrete db. This login and password will be used in your site.php. . Concrete Mysql username: [main root user] and password [password]. Some people use Putty and mysql commands to do this.


14. NEXT RESTORE THE WAMPSERVER 'CONCRETE' DATABASE TO THE VPS SETUP
I found that it was easiest to use most recent database backups made from the DASHBOARD while in Wampserver and logged into Concrete. Logged into Virtualmin with your Concrete5 db selected in the dropdown, Pick Edit Database, double click on "Manage" to the right of the "concrete" database. Then select "Execute SQL". Then select "Run from SQL File", Pick Radio button "From uploaded file". Pick "Browse" and browse to "C:/wamp/file/backups" on your computer and then pick the most recent correct db backup. Then pick Go. It should execute the SQL and populate the "Concrete" db.


15. TRY TO LOAD YOUR CONCRETE VPS WEBSITE
Use your browser to load the website. Make note of the error codes if you get them. You may have to adjust table capitalization if you got the table capitals wrong, and have to do the concrete db all over.


16. CONCRETE AND THE VPS SPEEDUP -works ok but it needs to be faster.
In Concrete Dashboard turn on the cache and turn off statistics.
In Virtualmin change the PHP settings. This is similar to speed improvements made for Wampserver
Goto Virtualmin > select the concrete5 website from dropdown > Services > PHP5 Configuration

then select "Resource Limits"

Memory and transfer limit options
Maximum memory allocation 16m -Changed to 25m
Maximum HTTP POST size 8m
Maximum file upload size 2m -Changed to 64m
Maximum execution time 30 seconds -Changed to 60 seconds
Maximum input parsing time 60 seconds -Changed to 300 seconds

then select :MySQL database connection settings"
Allow persistent database connections? Yes
Maximum persistent connections? Unlimited
Maximum total connections? Unlimited
MySQL connection timeout? 60 seconds
Default MySQL server host localhost
Default MySQL server port 3306
PostgreSQL database connection settings
Allow persistent database connections? Yes
Automatically re-establish persistent connections? No
Maximum persistent connections? Unlimited
Maximum total connections? Unlimited

"Safe file access mode options"
Enable safe mode? No
Only require group IDs to match? No

"Miscellaneous other PHP settings"
Allow PHP scripts starting with <? ? Yes
Allow <% %> tags? No
Compress output with zlib? No
Flush output after every write? No
Allow opening of URLs as files? Yes
SMTP server for sending email localhost
SMTP port on server 25
Path to command for sending email None

17. You should probably enable Short Tags in the Dashboard to accomodate coding variances and practices. Short tags enable enable the use of <? instead of <?php. Concrete5 uses a lot of <? in PHP files.

18. I'd like to thank Franz Frz (forms & dbase), JGarcia (forms & dbase), PAMB (wampserver versioning) Michael Mnkras (Missing Mod, lots of help), JordanLev (galleries & slideshow), guythomas (scrapebooks), thePhilm (Zip-Ftp-Upload-Unzip, VPS & Mysql, Wamp no capitals problem) , Brainakazariua (Wamp no capitals problem, final push for VPS upload) and a host of others for their generosity and knowledge in helping me to get this site going. It has been a steep learning curve for me, Wampserver, phpAdmin, mySql, Concrete5, Virtualmin, Webmin, plus creating the site and preserving the older sites. At times I thought I would not be able to accomplish this and was ready to give up. Someone usually lent a head or I had a chance to reflect and ask some decent decipherable questions that people could answer! I am certain there will be other challenges, but we have it running on VPS now! The website is http;//www.shyc-cc.org

19. I've found that site is significantly faster when logged in as a registered user or member. If you are logged as editor or admin there is some overhead which slows it down, but the entire site is much faster than when running it locally on my computer under Wampserver!

Rick Gleason

PS I am going to try to attach a text file that I modified for capitalizing table files in Concrete 5.4.1.1 if I can't you'll find it under a different one of my posts.
-----------------------

1 Attachment

fcgleason