2

I'm a newbie upgrading an ExpressionEngine site from 1.6.8 to 2.7.2. I did this on my local server. Worked pretty well but I lucked out since I don't have any add-ons to upgrade. However, not everything is showing up on my home page or control panel. I'm guessing that the other navigation links and some css and image srcs are tied to the site_url in the database, which would be looking for these elements on mydomain.com and not the local server.

I'm assuming that this would all be OK when uploaded to the remote server and the absolute paths are restored, but I want to be careful. Can I change the {site_url} in the database or admin somewhere to check this and give it another look? Should I just upload changes from localhost and make the necessary adjustments in the control panel?

3

To get all your paths/urls changed is a bit of a PITA since they are located in so many different sections of the CP. The easiest way to do this is with an addon. The two most popular are:

Deeploy Helper $22 (I prefer this one - use it on almost every build)

or

REElocate (free)

| improve this answer | |
2

Set the value of $config['site_url']on the file system/expressionengine/config/config.php.

But you gonna maybe have to set another variables, too:

  • $config['cp_url']
  • $config['tmpl_file_basepath']
  • $config['avatar_path']
  • $config['avatar_url']
  • $config['captcha_path']
  • $config['captcha_url']
  • $config['theme_folder_path']
  • $config['theme_folder_url']

And don't forget about the file upload preferences.

Take some time to study about config.php. It will save your life sometimes.

| improve this answer | |
  • I don't see site_url in that particular file (I see cp_url and base_url). I forgot to mention I'm using EE Core... – user1491394 Nov 14 '13 at 21:13
  • 1
    You should see $config['site_url'] in there, but you can add it if it's not there. – Jay F Nov 14 '13 at 23:25
2

In your config.php, you can set the site URL like this, and it should work on both your localhost and live server without needing to be updated.

$config['site_url'] = 'http://' . $_SERVER['HTTP_HOST'];

Or, you can put the literal URL in there, and edit it once you move the file from server to server.

| improve this answer | |
1

Another option is to use Focus Lab's Master Config. It connects into your config.php file and creates the concept of multiple server environments with their own individual configuration options. It also sets a lot of the path and URL config variables dynamically, making moving between servers painless.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.