Page 2 of 2
Re: Problem with transfer from local to webserver
Posted: Sat Dec 09, 2006 11:06 am
by cmsms fan
Hi all,
Fell very frustrated when I write this : ???The change of server is not working on cmsms , how can it be for such a good csm ?I cannot be redoing the whole website whenever it has to change server(from the testing server, to my personnal and finnaly to the client's...)
Either the documentation is not clear or I am too dool/ignorant. But how come can one succeed to built something like this
http://judwan.freehostia.com/appta/ and still be unable to move it between servers ?
Urgent help, with step by step details on how to do it highy needed please.
Thanks in advance
cmcms fan
Re: Problem with transfer from local to webserver
Posted: Sat Dec 09, 2006 5:50 pm
by Dee
This is how I usually move a site to a new location:
* do a clean install on the new webserver (this will copy the default files, set folder permissions and create a working config.php)
* install any modules you will be using on the website (preferably using Module Manager/XML)
* create a database backup of the new site, on the old server (use PHPMyAdmin if you have no commandline access/experience):
- in PHPMyAdmin select your database, click "Export", check "save as file" and click "Go", save the db backup file somewhere on your computer.
* drop all tables in database on the new server:
- in PHPMyAdmin select the (new) database, click "Check all" so all tables are selected, click the red cross to drop/delete the selected tables
* restore the database on the new server with the db backup file:
- in PHPMyAdmin select the (empty) database, click "Import", click "Browse", select the db backup sql file you saved on your computer and click "Go"
* Copy non-standard files to the new server (images, etc.), note: files in the uploads folder are best re-uploaded through the CMS admin, or you'll have to change permissions on them (if you upload through FTP, the webserver will probably not have write access, so you can't modify the files using the CMS File/Image Manager.
Hope that helps,
Regards,
D
Re: Problem with transfer from local to webserver
Posted: Sun Dec 10, 2006 5:01 am
by Dr.CSS
Re: Problem with transfer from local to webserver
Posted: Fri Dec 15, 2006 4:11 pm
by cmsms fan
Hello Dee,
I tried to follow your steps for the transfer of databases using phpmy admin.
I succeed to do the export without problem and get a sql file with all the details on my old database.
The problem I have is at the import level, phpmy admin gives error messages.
The first time the error was that " acces denied to XXXX database ". I did undestand that the login parameters of the old databases were the cause of this error.So I opened the txt mysql document and replaced all the all old login with new server parameters.
Now when executed, I get the following error #1045 - Access denied for user 'cpanel'@'209.190.85.23' (using password: NO)
Another trial gave but this other error " #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-
CREATE DATABASE `judym_appta` DEFAULT CHARACTER SET latin1 COLLATE latin1_' at line 1 "
So is there any modification I need to do on the exported sql text file ?
Thanks in advance for your reply
cmsms fan
Re: Problem with transfer from local to webserver
Posted: Fri Dec 15, 2006 10:12 pm
by Dee
cmsms fan wrote:
The problem I have is at the import level, phpmy admin gives error messages.
The first time the error was that " acces denied to XXXX database ". I did undestand that the login parameters of the old databases were the cause of this error.So I opened the txt mysql document and replaced all the all old login with new server parameters.
Very odd, it looks as if the database user that is used by PHPMyAdmin to connect to mysql doesn't have access to the database you want to use.
You are using the same database as you used to install CMSMS on the new server (step 1)?
Were you able to empty it (drop all tables) from PHPMyAdmin (step 4)?
Test if you're able to create a table in the database and drop it using PHPMyAdmin.
There should be no reason to edit the sql file, it doesn't contain any login information or "parameters", it just adds tables and data.
This is the start of the sql file when I export my current database:
Code: Select all
-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 15, 2006 at 10:34 PM
-- Server version: 5.0.26
-- PHP Version: 4.4.4-pl8-gentoo
--
-- Database: `cmsms`
--
-- --------------------------------------------------------
--
-- Table structure for table `cms_additional_htmlblob_users`
--
CREATE TABLE `cms_additional_htmlblob_users` (
`additional_htmlblob_users_id` int(11) NOT NULL,
`user_id` int(11) default NULL,
`htmlblob_id` int(11) default NULL,
PRIMARY KEY (`additional_htmlblob_users_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
If you execute that query from PHPMyAdmin (select the empty database, click SQL, paste the query and click 'Go') it should create the cms_additional_htmlblob_users table.
cmsms fan wrote:
Now when executed, I get the following error #1045 - Access denied for user 'cpanel'@'209.190.85.23' (using password: NO)
Hmm, so your PHPMyAdmin tries to connect to mysql (to execute the sql code) as user cpanel without using a password... that is probably why access is denied. I have no experience with CPanel, but that seems some kind of configuration error. Or maybe you have the possibility to log into PHPMyAdmin using some admin mysql user, or the database user you will be using for CMS?
cmsms fan wrote:
Another trial gave but this other error " #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-
CREATE DATABASE `judym_appta` DEFAULT CHARACTER SET latin1 COLLATE latin1_' at line 1 "
The file contents was no valid SQL when you tried that (syntax error); you messed something up
cmsms fan wrote:
So is there any modification I need to do on the exported sql text file ?
Nope, none at all normally, unless you would like to change table prefixes or something like that.
So: make sure you are able to create tables in the new (and empty) database from PHPMyAdmin, only then will you be able to import the sql.
If you have commandline access to the new server you could also try importing the data by giving this command:
mysql -u username -p database < backupfile.sql
Regards,
D
Re: Problem with transfer from local to webserver
Posted: Mon Dec 18, 2006 11:08 am
by cmsms fan
Hi Dee,
I gave another try this morning. This is exactely the steps I followed :
- Logged into the old site and through a PHPmy admin controp panel, I did an export of my site into an sql file that I save don my computer.
- Logged into the new site , to phpadmin where I log into my database using the account I used when creating the database to ge used with cmsms.
- Selected all the tables and deleted them until I receive a message, no table in this database.
- Go to menu sql , then paste the text copied from the saved sql export or another method was to give the path to text file to be executed.
- After execution this is the message I receive :
Erreur
requête SQL:
-- phpMyAdmin SQL Dump
-- version 2.6.4-pl2
-- http://www.phpmyadmin.net
--
-- Serveur: mysql2.freehostia.com
-- Généré le : Lundi 18 Décembre 2006 à 10:54
-- Version du serveur: 4.1.11
-- Version de PHP: 4.3.10-16
--
-- Base de données: `judwan_appta`
--
CREATE DATABASE `judwan_appta` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
MySQL a répondu:
#1044 - Access denied for user 'b31_182615'@'%' to database 'judwan_appta'
Note that 'b31_182615' is my user account on the new server and 'judwan_appta' , the name of the database on the old server.
What did I messed with or did wrong ?
Thanks for your support !
cmss fan
Re: Problem with transfer from local to webserver
Posted: Mon Dec 18, 2006 12:45 pm
by Dr.CSS
Just for fun, Did you try the other way?...
Works for me every time...
I did it 18 times in the last couple weeks, this is one site/look/template that is being used for all 18, I made one, got one the way they wanted then transfered "my way" to the other 17...
http://www.gochinasites.com/index.php look under all cities to see how many...
Re: Problem with transfer from local to webserver
Posted: Mon Dec 18, 2006 12:53 pm
by Dee
Somehow you also have the CREATE DATABASE statement in your backup (it doesn't do that when I export a db using PHPAdmin overhere).
Delete that line from the backup file:
CREATE DATABASE `judwan_appta` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci
The sql should only create the tables and fill them (it should start with a CREATE TABLE line)
Re: Problem with transfer from local to webserver
Posted: Mon Dec 18, 2006 6:31 pm
by cmsms fan
Hello Mark,
I did tried your way of transfer from one site to another a least 7 times.This is what I did each time:
- Install fresh copy of cmsms on new server and install all templates, modules, used on the old site
- Install databasebackup successfully and run a first backup so as to obtain a txt file stored in the admin folder of my new server installation
- Installed the same databasebackup on the old server and ran a database backup that I saved somewhere on my computer.
- Via FTP i copied this backup into the admin folder of the new server, exactely where the fresh backup is saved
-On the new server I go to extensions, database backup and choose to restore.I am warned that by doing so I will have my tables oweritten...I confirm the restoration and it shows messages like creating tables...then done.
But after refreshing, logging off and on again to the site...no change, I still have the texts and settings of the standard installation.
May be when installing I should not check install sample content and templates ?
Anyway, this is what I have been doing all these seven times, without success.
Also something I wish to note is that, using database backup / mysqldump, I end up with a file of about 467 K while doing an export with phpmy admin gives a file of about 1089 k...
So Dear Mark, what did I do wrong, what shall I do to have it working your own way?
Thanks for your reply.
cmsms fan
Re: Problem with transfer from local to webserver
Posted: Tue Dec 19, 2006 2:58 am
by Dr.CSS
Have you gone to Site Admin > global setting and cleared the cache?