1

EE 5.3.0

I have a website that I built using a production domain (let's call it production.com) to replace an old site using the desired domain (let's call it domain.com).

I am concerned with the default base_url setting in making such a change. My experience with domains and such is low and I'm worried that if I change that base_url to the new domain I'll loose access to the control panel. So my thinking was to find that field in the database and I could change it directly if need be, but I can't seem to find that value anywhere.

Does anyone know where that value is saved in the database or if there's a better way to going about doing something like this?

Thanks!

1 Answer 1

5

Well, it doesn't particularly matter where it is stored in the database, as you can override that value in your config file.

https://docs.expressionengine.com/latest/general/system-configuration-overrides.html https://docs.expressionengine.com/latest/general/system-configuration-overrides.html#base_url

So as long as you have access to the file system, you can set it how you want via SFTP/SSH. Just for some fun trivia, in the database, that setting lives in the exp_sites table in the site_system_preferences column. That column is base 64 encoded and serialized, so if you really needed to edit it in the database, you'd have to run a script like this:

$site_system_preferences_dump = unserialize(base64_decode('')); // string you pull from the database in whatever fashion you choose

$site_system_preferences_dump['base_url'] = 'https://my.new.site.url.dev';

$site_system_preferences_import = base64_encode(serialize($site_system_preferences_dump));

// put the $site_system_preferences_import (a string now) into your DB row
1
  • 1
    You are a life saver as usual! This is exactly what I needed. I am so relieved now! Commented Nov 26, 2019 at 18:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.