ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Driving me crazy! - Move local EE to hosted server?

April 06, 2008 4:22pm

Subscribe [3]
  • #1 / Apr 06, 2008 4:22pm

    aftershock

    46 posts

    This is driving me crazy.

    I have been developing my site locally (OS X) for around three months now. It’s time to move the site onto my VPS server where my DNS etc is already for it.  Herein lies the problem. I can’t get it to work at all!

    Copying the site and MySQL database across, changing the paths within the config.php file fails. I realise that this is because my local development site has been with a .dev extension and the actual site is a .com.

    I can login to the control panel but the screen is just blank. Also the site does not show, white screen.

    Question:

    What is the process for successfully moving my local build site to my VPS so that the site works and I can log in. Surely this should be simple?

    P.S. I have seen this thread and copying the db without the exp_sites does not work for me.

  • #2 / Apr 06, 2008 5:25pm

    aftershock

    46 posts

    Ok I have a solution.

    If you work on a locally on a development machine and want to move your site to ‘production’ or your web-host then this is one way I got mine to work.

    Just for background information, when I am developing a site locally (I’m on OS X) I set up a host name of the site to have a .dev extension. So if my actual production site was to be jameswhittaker.com then my dev system would have a host name of jameswhittaker.dev. I also develop my sites using templates stored as files, which are located inside my system folder.

    Before we do anything login to your local ‘development’ EE control panel and go to Admin > Utilities > Clear Cached Data select AllCaches and press submit.

    1) Backup your local ‘development’ site AND database. I use CocoaMySQL on the Mac for administering my databases.

    2) Export your database as SQL (best to add drop table to exports if you can) and save as a file. Save as raw SQL, not as a ZIP or anything like that.

    3) Open up your FTP program (Transmit on OS X) and open up your sites directory on your web host.

    4) Copy over everything from you local EE to your webhost, including your .htaccess file. EXCEPT any install.php (which you should have removed anyway).

    5) Edit the config.php file on the remote server with your new server & MySQL details then save.

    6) On your local machine, find the SQL file we saved in step 2 and open in your favourite text editor (TextMate on OS X). Now do a global find and replace. Replacing your sites name with the .dev extension to your .com extension (or whatever). Now save the SQL as a copy, keeping your original.

    7) Now import your SQL file that we saved in step 7 to your remote database.

    8) Go to your hosted sites admin control panel. It will look awful and be totally unstyled, we will fix that now. Go to Admin > System Preferences > Theme Folder Path and change to the path on your remote host to your themes folder. Now go to Templates > Global Template Preferences and change ‘Basepath to Template File Directory’ to your new path on your web host.

    9) Now make sure that your uploaded file contents’ permissions are set correctly as per the installation docs. If you are unable to turn your site off from the control panel this is because you have not set your permissions properly on your uploaded files & folders (specifically config.php).

    Also you will have to change your file upload paths as they will be different between systems due to the server path.

    Don’t forget that you also have to copy the .htaccess file across too!


    Done!

    Now obviously if you are using external template files go through those and change any .dev extensions to your production extensions ( I forgot first time round!).

  • #3 / May 29, 2008 4:53am

    Kevin Smith

    4784 posts

    Alright, I’ve been round and round with different methods for hours. Yours has gotten me the closest, but when I try to login to the CP, I get “The username you submitted was not found in the database” which is not true at all. (For what it’s worth, the CP login is unstyled and the main page of the site just shows up blank.) What am I doing wrong? Believe me, I’ve searched, and no one seems to have run across this same problem.

  • #4 / May 29, 2008 5:40am

    aftershock

    46 posts

    Hi, did you follow all the steps above?

    Make sure you are using the right copy of your database and you have done a find and replace on your domain extension. The control panel will look unstyled until you do step 8, changing the path to your template folders. Check this path to make sure it is leading to the right directory.

    There should be no issues with the actual login, I didn’t have any so I would just check you process again. Usual ‘your mileage might vary’ but I have used the above steps a number of times recently without any problems.

    If you get an answer post it here.

    Sorry I can’t help anymore.

  • #5 / May 29, 2008 8:27am

    aftershock

    46 posts

    I have just had to reverse the process outlined above to move a copy of a production site back to a dev site. No problems at all, I would say check you paths are correct, including your paths in config.php.

  • #6 / May 29, 2008 6:40pm

    Kevin Smith

    4784 posts

    I’m starting to think that it’s a problem with my server’s configuration. I should mention that I’m using SVN to manage versioning on all the projects our company is involved in, so I just did a checkout of the repository on the staging server. It’s not the final location for the project, but just on a staging server so that the client can test it before we launch it. So it’s not sitting on a top level domain, but something like http://staging.hearsaynashville.com/clientname.

    Anyone had any problems using Subversion to manage project deployment? If it works like it’s supposed to, it would make deployment so much quicker.

  • #7 / May 29, 2008 7:44pm

    Kevin Smith

    4784 posts

    Just installed a fresh EE on the staging server, and it works. So if there’s a problem with my staging server then it’s only a problem as far as a difference between local and staging.

    Local: OS X Leopard running Apache 2.2.8/PHP 5.2.5/MySQL 5.0.45

    Staging: Ubuntu 7.10 Server running Apache 2.2.4/PHP 5.2.3/MySQL 5.0.45

    All basically the same, I can’t imagine that one of those is causing a problem. Any known issues with the collation on the db? It seems like it’s latin1_swedish_ci for some reason. Shouldn’t matter either though, it’s that way locally and on the staging server.

  • #8 / May 30, 2008 5:08pm

    Kevin Smith

    4784 posts

    Well, I was finally able to login. Still unstyled, but I could login when I made sure that the exp_sites table remained untouched (previously I had used a search/replace in textmate, and it replaced some values in that table).

  • #9 / May 30, 2008 5:59pm

    Justin Hurlburt

    344 posts

    Greetings!

    hearsay,

    Have you tried navigating to Admin -> System Preferences -> General Configuration : and checking to see that the url to your themes folder, and Theme Folder Path are correct?

  • #10 / May 30, 2008 6:04pm

    Kevin Smith

    4784 posts

    Hey, thanks for the response! Yes, and it’s all working now. I was going to post an update to my progress here once I got to a stopping point. The other thing I had to do was switch my staging server configuration because it was causing me problems with relative paths. On my local machine, it’s acting like a top level, and I was trying to use a subfolder on the staging server. Once I switched this particular client’s staging setup to a subdomain, everything’s fine!

    One interesting thing I’m noticing, a little off-topic here, is that my local setup seems to ignore “smart quotes”, while the staging server spits out the usual weird characters (i.e. �). Something to do with my MySQL setup maybe? Anyone know?

  • #11 / May 30, 2008 6:12pm

    Justin Hurlburt

    344 posts

    Glad you got it working, that’s probably database collation, you could try changing it to UTF8, but it shouldn’t have any impact on your production server.

  • #12 / Jul 20, 2008 5:29pm

    aftershock

    46 posts

    Update.

    As I have recently found out, if you are moving a site from one domain to another (could be remote or local) with different length names then you are in trouble. You will not be able to login as directed above.

    The above steps work fine if you are moving from say jameswhittaker.dev to jameswhittaker.com because they have the same number of letters.

    To get around the issue the only solution i found was to install a clean copy of EE onto you destination server. Then from your old server export your SQL but leave out any cache tables and the exp_sites table.

    Now copy over your files and templates to your new server, then import the SQL you just generated from you old server. You will now be able to login. But certain things will be broken. I had issues with the pages module and had to recreate all of my existing pages URL mappings. I guess it is because they are held within the exp_sites table.

    So after a very painful experience I just hope that EE version 2.0 will make this hassle a thing of the past.

    Hope this helps someone in the future.

  • #13 / Jul 26, 2009 11:59pm

    Juliano Silva

    63 posts

    Hi folks, I came across this post and it’s been really helpful to me, to a certain degree. I have followed all the 9 steps above to transfer one local copy of EE to a remote server. Everything works fine except one thing that I just noticed. The images under my portfolio do not work. They don’t show up whatsoever. I even checked the server path to upload directory but that’s correct. What’s funny is that on my computer(where the local copy is) everything works fine when accessing the remote .com but when I went to a different computer, the images don’t show up. I was wondering if you ran into this before. Check it out for yourself http://www.julianomoreira.com/site/work Thanks in advance!

  • #14 / Jul 27, 2009 12:13am

    Lisa Wess

    20502 posts

    That method was fine when this post was created however you do not want, past 1.6, use find and replace on your database.  That is because the config values were moved to the exp_sites table as a serialized array and you will completely hose your site by doing such a find and replace.

    Instead you need to login via the CP and update those paths through the CP.  There is a Deeploy Helper module that might be able to help but I have no personal experience with it.

  • #15 / Jul 27, 2009 12:20am

    Juliano Silva

    63 posts

    Lisa, thanks for the quick reply. I have updated those paths through CP in additional to doing the find and replace in the DB. I also noticed that the status bar in my browser is trying to communicate with the .dev extension as opposed to .com. It’s weird! Did you have a chance to look at the site? Thanks again!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases