Page 1 of 2

Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Sun Jan 06, 2008 5:44 pm
by Deak
Disclaimer: I tried the technique described in the Wiki and I have also worked through several more thorough examples in the forums. I've also read this, and feel slightly dismayed. :)

I think my issues relate to how/what I need to edit in my config.php.

Here's the situation. I have a fully working CMSMS site living happily on our Linux web server. Now I would like to copy the whole thing onto my (Windows XP) laptop so that I can demo it to people.

On my laptop I have installed WAMP and have verified that it can run CMSMS, by installing CMSMS afresh and running the demo site. This works okay and I have now removed it ready for my own site.

Here's the problem...

When I copy my website to the laptop (having restored and configured the database via phpMyAdmin) this is what I get:

1. All of the site's stylesheets are missing/broken.
2. Website title is missing; it reads " - ".
3. All of the content and pages are missing, but oddly my logo is there!
4. Logging into the Admin area, the form takes me to the live website.

I have edited the config.php, setting:

$config['root_url'] = 'http://localhost:81/cmsms';

But I'm unsure about how to set the rest of the details. For example:

$config['image_uploads_path'] = '/var/www/vhosts/mydomain.com/httpdocs/uploads/images';

Is a Linux-type path, so should I set this to:

C:/wamp/www/cmsms/uploads/images ?

Thanks very much for any guidance and I would like to say that this would be a great thing to get added to the Wiki. This page is really not good (sorry whoever wrote it; it just makes enormous assumptions about an individual's setup and technical background).

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 5:49 pm
by Nullig
I don't believe you need the C: in the path just /wamp/...

Nullig

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 5:59 pm
by Deak
Hi Nullig, thanks for the speedy response. I had actually tried setting the paths sans the drive letter prefix but no joy. I gave it another bash though (just for sanity's sake), but still no luck. Here's my full config.php if this is any help to anyone:
Global Settings in the admin panel)
#after making any changes to path or url related options

#-----------------
#Database Settings
#-----------------

#This is your database connection information.  Name of the server,
#username, password and a database with proper permissions should
#all be setup before CMS Made Simple is installed.
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'cmsms_user';
$config['db_password'] = 'mypassword';
$config['db_name'] = 'cmsms';

#If app needs to coexist with other tables in the same db,
#put a prefix here.  e.g. "cms_"
$config['db_prefix'] = 'cms_';

#Use persistent connections?  They're generally faster, but not all hosts
#allow them.
$config['persistent_db_conn'] = false;

#Use ADODB Lite?  This should be true in almost all cases.  Note, slight
#tweaks might have to be made to date handling in a "regular" adodb
#install before it can be used.
$config['use_adodb_lite'] = true;

#-------------
#Path Settings
#-------------

#Document root as seen from the webserver.  No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://localhost:81/cmsms';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = '/wamp/www/cmsms/';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = '/wamp/www/cmsms/tmp/cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = '/wamp/www/cmsms/uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';


#---------------
#Upload Settings
#---------------

#Maxium upload size (in bytes)?
$config['max_upload_size'] = 2000000;

#Permissions for uploaded files.  This only really needs changing if your
#host has a weird permissions scheme.
$config['default_upload_permission'] = '664';

#------------------
#Usability Settings
#------------------

#Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
$config['use_smarty_php_tags'] = false;

#CMSMS Debug Mode?  Turn it on to get a better error when you
#see {nocache} errors.
$config['debug'] = false;

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = true;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = true;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

#--------------
#Image Settings
#--------------

#Which program should be used for handling thumbnails in the image manager.
#See http://wiki.cmsmadesimple.org/index.php ... ge_Manager for more
#info on what this all means
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = 'wamp/www/cmsms/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';


#------------------------
#Locale/Encoding Settings
#------------------------

#Locale to use for various default date handling functions, etc.  Leaving
#this blank will use the server's default.  This might not be good if the
#site is hosted in a different country than it's intended audience.
$config['locale'] = '';

#In almost all cases, default_encoding should be empty (which defaults to utf-8)
#and admin_encoding should be utf-8.  If you'd like this to be different, change
#both.  Keep in mind, however, that the admin interface translations are all in
#utf-8, and will be converted on the fly to match the admin_encoding.  This
#could seriously slow down the admin interfaces for users.
$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';

#---------------------------------------------
#Use the old stylesheet logic?  It's much slower, but it works with older
#versions of CMSMS.  You'll also need this set to true if there is a module
#that uses a stylesheet callback.  Leave it as false instead you really
#need it.
$config['old_stylesheet'] = false;

# URL of the Admin Panel section of the User Handbook
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php ... dmin_Panel';

#Enable backwards compatibility mode?  This basically will allow some
#modules written before 1.0 was released to work.  Keep in mind that this
#will use a lot more memory and isn't guaranteed to fix the problem.
$config['backwards_compatible'] = false;

#Not used anymore... kept around, just in case
$config['disable_htmlarea_translation'] = false;
$config['use_Indite'] = true;
?>

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 6:11 pm
by Dr.CSS
I'm using Xampp and have 2 installs that work, here is my config...

Global Settings in the admin panel)
#after making any changes to path or url related options

#-----------------
#Database Settings
#-----------------

#This is your database connection information.  Name of the server,
#username, password and a database with proper permissions should
#all be setup before CMS Made Simple is installed.
$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'root';
$config['db_password'] = '';
$config['db_name'] = 'twice';

#If app needs to coexist with other tables in the same db,
#put a prefix here.  e.g. "cms_"
$config['db_prefix'] = 'cms_';

#Use persistent connections?  They're generally faster, but not all hosts
#allow them.
$config['persistent_db_conn'] = false;

#Use ADODB Lite?  This should be true in almost all cases.  Note, slight
#tweaks might have to be made to date handling in a "regular" adodb
#install before it can be used.
$config['use_adodb_lite'] = true;

#-------------
#Path Settings
#-------------

#Document root as seen from the webserver.  No slash at the end
#If page is requested with https use https as root url
#e.g. http://blah.com
$config['root_url'] = 'http://localhost/twice';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on')
{
$config['root_url'] = str_replace('http','https',$config['root_url']);
}

#Path to document root. This should be the directory this file is in.
#e.g. /var/www/localhost
$config['root_path'] = 'C:\xampp\htdocs\twice';

#Name of the admin directory
$config['admin_dir'] = 'admin';

#Where do previews get stored temporarily?  It defaults to tmp/cache.
$config['previews_path'] = 'C:\xampp\htdocs\twice\tmp\cache';

#Where are uploaded files put?  This defaults to uploads.
$config['uploads_path'] = 'C:\xampp\htdocs\twice\uploads';

#Where is the url to this uploads directory?
$config['uploads_url'] = $config['root_url'] . '/uploads';


#---------------
#Upload Settings
#---------------

#Maxium upload size (in bytes)?
$config['max_upload_size'] = 32000000;

#Permissions for uploaded files.  This only really needs changing if your
#host has a weird permissions scheme.
$config['default_upload_permission'] = '664';

#------------------
#Usability Settings
#------------------

#Allow smarty {php} tags?  These could be dangerous if you don't trust your users.
$config['use_smarty_php_tags'] = false;

#CMSMS Debug Mode?  Turn it on to get a better error when you
#see {nocache} errors.
$config['debug'] = false;

#Automatically assign alias based on page title?
$config['auto_alias_content'] = true;

#------------
#URL Settings
#------------

#Show mod_rewrite URLs in the menu? You must enable 'use_hierarchy' for this to work for modules
$config['assume_mod_rewrite'] = false;

#Extension to use if you're using mod_rewrite for pretty URLs.
$config['page_extension'] = '';

#If you don't use mod_rewrite, then would you like to use the built-in
#pretty url mechanism?  This will not work with IIS and the {metadata} tag
#should be in all of your templates before enabling.
$config['internal_pretty_urls'] = false;

#If you're using the internal pretty url mechanism or mod_rewrite, would you like to
#show urls in their hierarchy?  (ex. http://www.mysite.com/parent/parent/childpage)
$config['use_hierarchy'] = false;

#If using none of the above options, what should we be using for the query string
#variable?  (ex. http://www.mysite.com/index.php?page=somecontent)
$config['query_var'] = 'page';

#--------------
#Image Settings
#--------------

#Which program should be used for handling thumbnails in the image manager.
#See http://wiki.cmsmadesimple.org/index.php ... ge_Manager for more
#info on what this all means
$config['image_manipulation_prog'] = 'GD';
$config['image_transform_lib_path'] = '/usr/bin/ImageMagick/';

#Default path and URL for uploaded images in the image manager
$config['image_uploads_path'] = 'C:\xampp\htdocs\twice\uploads\images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';


#------------------------
#Locale/Encoding Settings
#------------------------

#Locale to use for various default date handling functions, etc.  Leaving
#this blank will use the server's default.  This might not be good if the
#site is hosted in a different country than it's intended audience.
$config['locale'] = '';

#In almost all cases, default_encoding should be empty (which defaults to utf-8)
#and admin_encoding should be utf-8.  If you'd like this to be different, change
#both.  Keep in mind, however, that the admin interface translations are all in
#utf-8, and will be converted on the fly to match the admin_encoding.  This
#could seriously slow down the admin interfaces for users.
$config['default_encoding'] = '';
$config['admin_encoding'] = 'utf-8';

#---------------------------------------------
#Use the old stylesheet logic?  It's much slower, but it works with older
#versions of CMSMS.  You'll also need this set to true if there is a module
#that uses a stylesheet callback.  Leave it as false instead you really
#need it.
$config['old_stylesheet'] = false;

# URL of the Admin Panel section of the User Handbook
$config['wiki_url'] = 'http://wiki.cmsmadesimple.org/index.php ... dmin_Panel';

#Enable backwards compatibility mode?  This basically will allow some
#modules written before 1.0 was released to work.  Keep in mind that this
#will use a lot more memory and isn't guaranteed to fix the problem.
$config['backwards_compatible'] = false;

#Not used anymore... kept around, just in case
$config['disable_htmlarea_translation'] = false;
$config['use_Indite'] = true;
?>

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 6:35 pm
by Deak
Hi Mark,

I copied exactly the syntax for your paths (drive letter + backslashes) for everywhere appropriate, but no luck. Perhaps I am mistaken and this is not an issue with the config.php file?

Site Files

I've had a look through the folders and I appear to have all the right modules and uploaded images and such that I would expect for my site (I grabbed all the files and directories via FTP).

Database

I exported the database from the live server via phpMyAdmin as a .sql file and then imported it locally via the same method. Having then created the user and set their perms up, I assumed this would all be fine. I haven't missed something here have I? I've run a quick SELECT on the cms_content table and I can see all of my pages.

I'm at the point of even trying XAMPP, knowing that other people have it working, just to absolutely nail this down to an issue with my site or just my incompetence.

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 8:14 pm
by Nullig
I wonder if it has to do with the localhost:81 - do you have some firewall setting that redirects port 81?

I just checked my wamp server and my config paths are like:

$config['root_path'] = 'C:\wamp\www\cmsms';


Nullig

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 10:07 pm
by Deak
Nullig wrote: I wonder if it has to do with the localhost:81 - do you have some firewall setting that redirects port 81?

I just checked my wamp server and my config paths are like:

$config['root_path'] = 'C:\wamp\www\cmsms';
Hi Nullig,

I am just running the Windows firewall, and, as I said, I can get CMSMS running fine on my WAMP setup; it appears to be a problem just with my site missing its content and stylesheets. However, just to confirm the port theory I have stopped IIS, configured Apache to run on port 80, and retried my site on the laptop. No luck.

I've had a look at the HTML source for the broken page of my site and it is missing any kind of stylesheet in its header. I wonder why that is? The template itself looks right from a cursory look, although something is clearly wrong because the laptop version says it used 7 queries to generate the page and the live one reckons it used 18!

Thanks Nullig and Mark for your help on this, have some forum karma.  ;D

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sun Jan 06, 2008 11:58 pm
by Nullig
You could try copying all of the website files from your linux server to your wamp directory, copying the install directory from the original cmsms installation files and then running the install, but not installing the demo data. That way, the install should create the proper paths, etc. in the config.php file.

Try reinstalling the database fro phpMyAdmin as well.

Nullig

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Wed Jan 09, 2008 10:51 pm
by Pierre M.
Hello,
Deak wrote: I have a fully working CMSMS site living happily on our Linux web server. Now I would like to copy the whole thing onto my (Windows XP) laptop so that I can demo it to people.
If you only need to show your site rather than to demo its update you have the option of only statically mirroring it with httrack or wget.
Deak wrote: Here's the problem...

When I copy my website to the laptop (having restored and configured the database via phpMyAdmin) this is what I get:

1. All of the site's stylesheets are missing/broken.
2. Website title is missing; it reads " - ".
3. All of the content and pages are missing, but oddly my logo is there!
4. Logging into the Admin area, the form takes me to the live website.
My guess is a database access issue. CMSms can't read your database. I mean the PHPMySQL link. May be wrong guess. Can be config.php or MySQLServer settings.
Have you tried to access your database from a MySQL command line tool in order to try the access credentials ?

Pierre M.

Re: Moving site from remote server to local WAMP server (editing config.php issu

Posted: Sat Feb 09, 2008 12:33 am
by lriverstone
I had a similar problem when I copied my site from the web server to my laptop to run as a demo.

I started trying to edit the config.php file but couldn't get to work.  In the end I  copied the cms install file into the site directory and went though the install process again.  ie. http://localhost/mysite/install.php.

just rember to add the correct details for the database access and the table prefix and un check the box to create tables.

It worked fine for me.

Hope this helps

Re: Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Sun Aug 23, 2009 2:46 pm
by hugosnel
I used the fresh install and then copied my database to WAMP.
It works BUT the TinyMCE editor is not working...
Any ideas?
Runninig 1.6.4 Moindou

Re: Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Sun Aug 23, 2009 10:14 pm
by Dr.CSS
@hugosnel
Go to extensions > modules uninstall tiny, reinstall tiny, in the same page don't go to module manager and try to install there you will get an older version...

Re: Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Mon Aug 24, 2009 3:39 pm
by hugosnel
Yes thank you that worked.
Another problem I have run into with the move to local is that all pages I orginaly created I can no longer change the contents. They are not 'written'!
Any ideas?
TIA

Re: Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Mon Aug 24, 2009 3:51 pm
by Pierre M.
Hello,
hugosnel wrote: Another problem I have run into with the move to local is that all pages I orginaly created I can no longer change the contents. They are not 'written'!
Another problem => another thread.
Please start another thread with your System Info, some evidence PHP can write to your database (outside CMSms) and some reproducible working and nonworking CMSms use cases.

Pierre M.

Re: Moving site from remote server to local WAMP server (editing config.php issues?)

Posted: Mon Aug 24, 2009 3:55 pm
by hugosnel
Yes Pierre, normally I would do that, but it seems te me part of this thread title:
"Moving site from remote server to local WAMP server"
A consequense of moving? I can edit all EXCEPT the tables from tiny ..??