Update site settings after database import

There are a some scenarios, for example content migration, where you have to export the database from a DXP environment and import into the local environment.

As it seams really easy to export the database via Epi/Optimizely PaaS Portal and import into local machine there is one thing be aware of – there is no OOTB mechanism to adjust the site url and the site name in the site definitions / settings to your local site.

With this update SQL script you can easily do the job to change the site url and name to your local site.

update tblSiteDefinition
   set SiteUrl = 'http://localhost:59159/'
 where Name = 'My Site';

 update tblHostDefinition
	set Name = 'localhost'
	where fkSiteID = (select sd.pkID from tblSiteDefinition sd where sd.Name = 'My Site') and Type = 1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s