Page 1 of 1

[Solved]:Moving from offline version to server

Posted: Thu Jan 17, 2008 10:09 pm
by bdfy
I installed easyphp on my machine - it's much easier to play around with cms offline. I used the same database/user names as on server (cms is setuped on server too)  to avoid incompatibility. I changed some menus, added content. As i see all my changes are in tmp\templates_c\ folder. But i can't rewrite this files. i can't attributes of these files ((
I'm windows user and can't say i'm experienced web master. I access server ftp via Total Commander. Searching for solution i found this:
http://wiki.cmsmadesimple.org/index.php ... _using_FTP
Which means that a special script will have to be run. In CMS made simple 1.0, an ability to change permissions (and even remove) modules has been added.
How can i run it ?
Is there more simple solution to syncronize offline and online versions ?

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 2:41 am
by nivekiam
The /tmp directory is not where the templates and data are saved.  That's just a temporary location for cache and such.  The templates, data (content), stylesheets are all in the database.

You might want to look at this module.  Looks like it's in the early stages.  I was just reading about it.  Don't know if I'll ever have a need for it, but it sounds interesting:
http://forum.cmsmadesimple.org/index.ph ... 669.0.html

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 3:28 am
by Dr.CSS
It works but you have to know all settings, your best bet is to backup the database on your comp. the import it to the server to get all changes, make sure if you have images and such in the uploads folder or any where else you also upload them to server...

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 2:23 pm
by bdfy
IIUC i just have to save database on my machine and import it via phpmyadmin on server ? Ok, i tried. i saved DB to localhost.sql on my pc. Tnen i opened phpmyadmin on the server and tried to import it.
I got an error
Error

SQL query:

-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 18, 2008 at 04:03 PM
-- Server version: 5.0.27
-- PHP Version: 5.2.0
--
-- Database: `35415`
--
CREATE DATABASE `35415` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;


MySQL said: 
#1007 - Can't create database '35415'; database exists
on hoster's site it said (free hosting)
MySQL 5 support (v5.0.45) - one free db per account; database size is not limited!!!
one free db per account - can this be cause of the proublem ?

nivekiam
usefull link. though i can't see where i can get download link...

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 4:54 pm
by alby
bdfy wrote: IIUC i just have to save database on my machine and import it via phpmyadmin on server ? Ok, i tried. i saved DB to localhost.sql on my pc. Tnen i opened phpmyadmin on the server and tried to import it.
I got an error
In phpmyadmin uncheck when saved the "Create database" field, you have already your database (35415)

bdfy wrote: usefull link. though i can't see where i can get download link...
Site Pusher

Alby

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 5:43 pm
by bdfy
thanks for the link - i'll try it.
In phpmyadmin uncheck when saved the "Create database" field
Where's it ? - can't see anything like this nor in import nor in export windows :(

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 8:26 pm
by alby
bdfy wrote: thanks for the link - i'll try it.
In phpmyadmin uncheck when saved the "Create database" field
Where's it ? - can't see anything like this nor in import nor in export windows :(
My mistake, I have a modify version  ::)

If you export from server (your case from photo) you must delete row (about in first 15 row of file):
CREATE DATABASE `35415` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

Or enter in your DB 35415 and Export from that (select all tables)

Alby

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 8:36 pm
by bdfy
If you export from server (your case from photo) you must delete row (about in first 15 row of file):
CREATE DATABASE `35415` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
frankly speaking i didn'y understand a word :(

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 8:46 pm
by alby
bdfy wrote:
If you export from server (your case from photo) you must delete row (about in first 15 row of file):
CREATE DATABASE `35415` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
frankly speaking i didn'y understand a word :(
Delete this row from export file localhost.sql (this is your export file for inport on server):
bdfy wrote:
-- phpMyAdmin SQL Dump
-- version 2.9.1.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 18, 2008 at 04:03 PM
-- Server version: 5.0.27
-- PHP Version: 5.2.0
--
-- Database: `35415`
--
CREATE DATABASE `35415` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

OR (you don't must delete any row) in phpmyadmin enter before in your DB and in Export (always localhost.sql) select ALL tables

Alby

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 8:53 pm
by bdfy
ok. i deleted the line. no i got another error
Error

SQL query:

-- --------------------------------------------------------
--
-- 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 = latin1;


MySQL said: 
#1050 - Table 'cms_additional_htmlblob_users' already exists
i guess deleting all CREATE TABLE  lines is not a good way to go...

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 8:56 pm
by Nullig
Step-By-Step...

On your local machine:

- In phpMyAdmin Select the cmsms database from the dropdown in the lefthand pane. This will show the list of tables.

- Click on the Export tab in the righthand pane. This will bring up the "View dump (schema) of database" options screen.

- In the Export box, usually all the tables are pre-selected, but, just in case they aren't, click on the "Select All" link. This will select all of the tables in the database.

- Just below that, make sure the SQL radio button is selected.

- In the "SQL options" box make sure the "Structure" box has a checkmark.

- In the "Structure" box make sure that the following have checkmarks:

Add DROP TABLE / DROP VIEW
Add IF NOT EXISTS
Add AUTO_INCREMENT value
Enclose table and field names with backquotes

- In the "SQL options" box make sure the "Data" box has a checkmark.

- In the "Data" box make sure that the following have checkmarks:

Complete inserts
Extended inserts
Use hexadecimal for binary fields

- Also, in the "Data" box, ensure the "Export type" is set to INSERT.

- At the bottom, make sure that the "Save as file" box is checked.

- Click on the "Go" button.

- This will create a "sql" file - Select the "Save to Disk" option and click on the "OK" button.

- Find the file you just saved in your usual "downloads" directory and rename it to something like FullBackup-yyyymmdd.sql - I usually format the date like 20080110 for sorting purposes.

Now, you can use that backup to import into your live db.

Nullig

Re: Moving from offline version to server

Posted: Fri Jan 18, 2008 9:09 pm
by bdfy
great tute for a newby like me )) though i can be even better with just a few pictures ))
thanks. I finally made it  ;D

All the info exept images and iploaded files is stored into DB ? all new  stylesheets, templemates i may use ?

Re: [Solved]:Moving from offline version to server

Posted: Fri Jan 18, 2008 10:26 pm
by Nullig
Yes, everything should be there, except uploaded files and images.

If you FTP all of the files from your local cmsms directories to your production ones, you should have everything there.

Note: make sure you delete everything in tour /tmp/cache and /tmp/templates_c directories on the new server before you access it, to avoid cache errors. Also, make sure you set the permissions correctly on the new server directories (uploads, tmp, etc.)

Nullig

Re: [Solved]:Moving from offline version to server

Posted: Sat Jan 19, 2008 12:42 pm
by bdfy
make sure you delete everything in tour /tmp/cache and /tmp/templates_c directories on the new server before you access it, to avoid cache errors
that was my  question at the topic start  :) i can't nor replace/delete /change attributes of this files.
Anyway it's wotking ggod after simple import DB