Kingsley |
|
---|---|
Were there recently changes which influences the way a localhost and a live site works? Since a while I am not able to copy a localhost to live, or vice versa, without one or the other giving hell with logging in, with foreach errors, with tpls, with the markitup or ckeditor totally not functioning, etc It really is driving me nuts. Now I know I am on the bottom of the foodchain when it comes to programming, But Ever since Trust showed me how to copy stuff the correct way (like db and all) I never had any problems, up to 2 or 3 months ago.
The latest thing Trustmaster showed I already tried (Click for topic). That was the last time a copy from live to local went correctly. Now it goes south either way :( |
Trustmaster |
|
---|---|
Could you describe your workflow step-by-step, how you copy things over and what you do? E.g. that trick I showed you is quite rare, normally it is only needed when your site moves to another domain. Once set, cookie domain stays unchanged. I think the most important rule for live deployment is this: don't copy database and cache files (or better entire datas folder) from localhost to production server. May the Source be with you!
|
Kingsley |
|
---|---|
1. copy files (yes, included the whole datas file) 2. copy db (included add droptable) 3.insert db into localhost 4. remove cached files 5. edit config.php 6. the login error check -> if error apply your fix
This is the way you told me to do it back in the day, when I switched from Genoa to Siena. Always worked perfectly (datas folder included) up till the above.
when I design for an existing site, I always copy the live site to my localhost and then adjust the skin accordingly. New site I completely develop on localhost and then manually copy all the data into the new live site. But most work I do is on exsisting sites, so yeah, I often need to copy stuff to my localhost. I know this probably makes some (professional) programmers choke on their coffee or sandwich, but it's a way i feel comfortable with, and at the same time gives me a good look on the site and its content (images and such). |
|
Відредаговано: Kingsley (16.11.2012 20:37, 12 років тому) |
Trustmaster |
|
---|---|
That's quite a tedious path you follow every time :) It might be fine for a one-off action like Genoa2Siena migration, but there's no need to do it with regular updates. First, let's repeat the rule #1: don't copy entire database and datas from localhost to production, it breaks things. Apart from that login issue, you loose all the data that has been added by users on the production site from the period you made a dump of it for your localhost. Then, let's make it clear that there are different kinds of updates that you make to the production site:
Now comes the rule #2: these kinds are handled differently. Cotonti updates These are described here. Shortly, after downloading another cotonti update, just overwrite the old files and run install.php to update the database. I apply the same procedure to localhost first and if it is fine, I apply the same procedure to the production site (without copying stuff to localhost and back again). Theme updates Edit and test on localhost, then upload to production. Extension updates This gonna be the trickiest part. If you add new functions to your site and want to make them work on localhost first, then:
This is it. Content updates OK, here comes the rule #3: don't use localhost to update production site's contents. Really, use localhost to play with extensions and templates, but contents should be edited on the production site directly. Use Drafts, Validation queue and Permissions to hide stuff from visitors' eyes unless you want them to see it. Ah, and the rule #4: make backups of the production site from times to times. Just in case it all goes absolutely wrong one day. May the Source be with you!
|
Kingsley |
|
---|---|
Your list is quite longer than mine :P but I see what your pointing at. Well, your post is now in my cotonti folder for future reverence, so thank you for your elaborate answers. Cheers! |
Trustmaster |
|
---|---|
#36268 Kingsley: You're right, moving from localhost to production for the 1st time sounds reasonable too. But you have to fix config.php, cookiedomain/cookiepath in cot_config and clear cache (both in datas/cache and cot_cache table) for your production site to start working correctly. I think this can be added as a 5th case above. May the Source be with you!
|
Kingsley |
|
---|---|
As said, I will follow this path now.. |