we caboodle News

Base Url Change Magento 2

News Categories: MagentoWeb Caboodle News

This article was published on: 04/16/21 7:47 PM

We come across this from time to time and it’s a common issue when a client changes their domain name due to a rebrand or upgrade from .co.uk to .com

When we changed a Base Url Change Magento 2 there are several sets to take but as always please take this as a guide and backup, backup and backup before modifying your Database.

So, let’s dive straight and take an example that our client is changing from a .co.uk to a .com. example www.domain.co.uk to www.domain.com


Lets Go.

Log in to your server via SSH (we are using a terminal on a mac)

Connect to your Database – this can be controlled like this:

mysql -u root -p 

Enter password when asked.

Then we need to update baseurl in core_config_data:

UPDATE core_config_data
> SET value = 'http://www.yourdomain2.com/'
> WHERE path IN ('web/secure/base_url', 'web/unsecure/base_url')

Next Step

UPDATE core_config_data
> SET value = REPLACE(value, 'http://www.domain.co.uk/', 'http://www.domain.com/')
>WHERE path = 'design/head/includes';

If this throws up an error use following: This happened to us on the MariaDB cloud server

Change the web/unsecure/base_link_url also:

UPDATE core_config_data
> SET value = 'http://www.yourdomain2.com/'
> WHERE path IN ('web/unsecure/base_link_url');


Then changed Store Url

php bin/magento setup:store-config:set --base-url="http://www.domain.com/"

php bin/magento setup:store-config:set --base-url-secure="https://www.domain.com/"

Finally to finish clearthe cache:

php bin/magento cache:flush


we caboodle - full service agency team

Ready to Start?

we are driven by the challenge of building a bespoke website for your business, improve SEO performance, fix UX/UI issues and streamline your branding across all social & paid channels.

Are you looking for a new, full service agency? contact us today for a free quotation or advice, and lets build something great, together!





    William Holt

    Meet Will

    I've been designing & developing websites for over 2 decades. my first project was built on Microsoft Frontpage, yes I go that far back!

    Speak to me direct regarding your next project or the benefits of switching your digital agency to Web Caboodle

    will@wecaboodle.com | 07368 229004 | LinkedIn Profile

    Web Design Manchester

    Studio 13
    Woolden Road

    Web Design London

    71-75 Shelton Street
    Covent Garden

    let's connect


    Copyright 2023 Web Caboodle - Web Design and Development Agency | We Website Design Ltd 13127888 Registered in England and Wales | Privacy Policy