Changing Domain of your Drupal Website? Don't miss this article!

by Rajesh Bhimani on Sep 21, 2022 Software 702 Views

We all have our names with addresses where people can find us. Similarly, the websites we use have certain names along with their unique addresses, popularly known as their domain names. These domain names help users to find the website and the correct domain name saves your huge marketing costs. Because people remember your website with its domain name and a name that is relevant to your business, attractive, and easy to remember helps reduce domain name marketing effort and expense. 

 

A domain name is among the important facets of a website. To protect your brand online, you need to get trademarked your domain name so that nobody else can use the domain name of your business. If other people will start using the same name in a similar pattern as yours, what will happen? Of course, it will create confusion among users and will impact your business conversion. 

 

If your website is running on Drupal and you are considering changing the domain name of your website due to any marketing reasons, you must peruse this article to know more about the Drupal website domain name change. 

 

Why you change your Drupal website domain name? 

Website domain name change might be inevitable for you at times. And it is leaving you all confused and concerned about the lengthy process of changing the website domain name. But FYI, it is painless and easier work, which you can complete in a very short time. 

 

There are umpteen reasons due to which you change your website’s domain name such as some crucial marketing reasons, business and services expansion, or maybe to enter into the international market you need a name that will look more professional and catchier to overseas audiences. 

 

There are myriad websites that changed their domain name when needed, for example, PayPal was X.com, Twitter was twttr.com and the very popular Facebook was thefacebook.com. 

 

How to change your Drupal website domain name? 

First of all, choose a new relevant domain name that you wish to register for your website. A name that reflects your business precisely and which is unique and eye-catching. Also, decide the extension for the domain name. 

 

When you are about to transfer your website to the new domain name, don’t forget to check all the links of subpages included. Thereby, after changing the name and transferring the Drupal site, the important links won’t miss out. 

 

Create and compare a sitemap for your current and new domains. It will help you to make sure that all the 301 redirects are working properly. The 301 redirects are crucial for our web page robots scanning. Also, notify Google about the domain name change, so that the new changes won’t impact your ranking in SERPs. 

 

Furthermore, you might be using a lot of external marketing and analytical tools, their configuration is directly connected to your domain name. So, if you are changing the domain name, configuration settings will get changed for these external tools as well. If the external tools are using Google tag manager, creating a copy of the container you are using is a good idea, with the tool configuration for the new domain. Thereby, eventually, you only have to change the container ID and you are all sorted. Also, you will save many scripts and tools’ downtime because of configuration settings changes. You may seek the help of any custom Drupal development agency to help you with that. 

 

One more important factor is to inform all the DNS servers of the new domain name. It might take some time, which is alright. But it should be a properly defined, well-planned process for the smooth execution of a website with the new domain name. 

 

The real work starts from here with Drupal.. 

After all these contemplation and configuration settings, check the entire code of the Drupal website to find the old domain name because the old name requires to replace by a new one. Verify all the installed modules and update all the files that are responsible for these modules’ settings with the new domain name. 

In the case of multisite installation, the user’s files are located in the following directory  

olddomain.com/sites/olddomain.com/files 

 

You have to change the module configuration to the following to avoid any future navigation problems 

newdomain.com/sites/olddomain.com/files 

 

The traffic is very important. To redirect the traffic from the old domain to the new one, you should add an entry to .htaccess file, which is available in the root folder of the web page. The newly added code will redirect the traffic from the old domain to the new domain. 

 

<IfModule mod_rewrite.c>  

      RewriteEngine On 

      RewriteCond %{HTTP_HOST} ^yourdoma$ [OR] 

      RewriteCond %{HTTP_HOST} ^www.staradomena.com$ 

      RewriteRule (.*)$ http://www.nowadomena.com/$1 [R=301,L]  

</IfModule> 

 

 

Once you are done with redirects, start re-building the sitemaps. It can be done in different ways according to the module you are using for sitemap creation. If you are using an XML sitemap, you can easily perform this rebuilding task from the module’s configuration option. And as mentioned above, sitemaps are used by the robots scanning of the website, which directly influences the website visibility and search engine ranking. 

And finally, clear the Drupal cache. It is an added step that helps the website function smoothly. Cleaning cache can be done in many ways. One of the most popular ways is using the Drush cr command or a manual cleaning in the UI at admin/config/development/performance. 

 

You can also clone your Drupal website to the new domain name…. 

 

Dump the database 

You can dump the database backup using three distinct methods. Choose anyone that is most suitable for you. 

  • By using the export function in PhpMyAdmin 

Click on the database name in PhpMyAdmin. You will find different buttons on the top menu, click on the Export button. After that Quick > Go > Save and backup saved on your local computer. 

  • Using mysqldump command 

In this method, connect to the server using SSH. Change directories to the live Drupal site’s location from the Linux terminal by using the cd command. Afterward, issue the mysqldump command for database dump. 

  • Dump the database using Drush 

Save the dump file to a location outside of the Drupal website location. Drush cloning makes a database dump and stores it. 

Copy the files to the new domain 

Now, sync the current Drupal site’s file to the new domain by using the rsync command. It will copy all files to the new Drupal domain. 

 

Create the new database 

New Drupal cloned site needs to have a new database as well. If you are using cPanel, click MySQL Databases from the databases section of the home page. And then create a new database, database username, and password. Check the settings in the new database so that no problem will arise in the future once the new domain will be live. 

 

Set the new database and domain details in setting.php file 

Now the new database and username, password is all set. So, you can replace the current Drupal site database settings with new cloned site database settings. For that, open the cloned site’s setting.php file with your text editor and replace the old database connections with the new ones. 

 

$databases['default']['default'] = array ( 

       'database' => 'drup177',  

       'username' => 'drup177', 

       'password' => '$password', 

       'prefix' => 'dr40_',  

       'host' => 'localhost',  

       'port' => '3306'

)

 

 

You have to set your current Drupal site domain name inside the setting.php file and change the setting to the new cloned site’s domain name. In the setting.php file’s $settings[‘trusted_host_patterns’] section, change the existing URL with the new URL. 

 

Import the dump to the new database 

After all this, import the database dump by applying the same method as you performed while making the dump.  

 

  • Using PhpMyAdmin 

Click on the new database name in your PhpMyAdmin panel and then click on the Import button. Select the database dump file you exported to your local computer and click on the Go button. 

  • Using MySQL command line 

Import the database dump by using the following command 

mysql drup338 < /yourdomainname/public_html/drup177_cloning.sqlhttps://article-realm.com/article/Computers/Software/28104-Changing-Domain-of-your-Drupal-Website-Dont-miss-this-article.html

Comments

No comments have been left here yet. Be the first who will do it.
Safety

captchaPlease input letters you see on the image.
Click on image to redraw.

Reviews

Guest

Overall Rating:

Statistics

Members
Members: 17144
Publishing
Articles: 79,595
Categories: 202
Online
Active Users: 1827
Members: 0
Guests: 1827
Bots: 7641
Visits last 24h (live): 9145
Visits last 24h (bots): 58388

Latest Comments

" '훌륭한 유용한 리소스를 무료로 제공하는 가격을 알 수있는 웹 사이트를 보는 것이 좋습니다. 귀하의 게시물을 읽는 것이 정말 마음에 들었습니다. 감사합니다! 훌륭한 읽기, 긍정적 인 사이트,이 게시물에 대한 정보를 어디서 얻었습니까? 지금 귀하의 웹 사이트에서 몇 가지 기사를 읽었으며 귀하의 스타일이 정말 마음에 듭니다. 백만명에게 감사하고...
" '훌륭한 유용한 리소스를 무료로 제공하는 가격을 알 수있는 웹 사이트를 보는 것이 좋습니다. 귀하의 게시물을 읽는 것이 정말 마음에 들었습니다. 감사합니다!   크롬하츠 토토    
" '훌륭한 유용한 리소스를 무료로 제공하는 가격을 알 수있는 웹 사이트를 보는 것이 좋습니다. 귀하의 게시물을 읽는 것이 정말 마음에 들었습니다. 감사합니다!   크롬하츠벳    
" '훌륭한 유용한 리소스를 무료로 제공하는 가격을 알 수있는 웹 사이트를 보는 것이 좋습니다. 귀하의 게시물을 읽는 것이 정말 마음에 들었습니다. 감사합니다! 훌륭한 읽기, 긍정적 인 사이트,이 게시물에 대한 정보를 어디서 얻었습니까? 지금 귀하의 웹 사이트에서 몇 가지 기사를 읽었으며 귀하의 스타일이 정말 마음에 듭니다. 백만명에게 감사하고...
Discover the difference with our exclusive Escorts in Gurgaon that sets the standard for excellence. Our Call Girls are not just visually stunning but also skilled in the art of pleasure....
이러한 유익한 웹 사이트를 게시하는 데 아주 좋습니다. 웹 로그는 유용 할뿐만 아니라 창의적이기도합니다.  타잔토토  
모든 댓글을 읽는 데 시간이 걸렸지 만 기사를 정말 즐겼습니다. 그것은 나에게 매우 도움이되는 것으로 판명되었고 여기의 모든 댓글 작성자에게 확신합니다! 정보를받을 수있을뿐만 아니라 즐길 수있을 때 항상 좋습니다. 앙벳 주소  
Visiting the city becomes an extraordinary experience when accompanied by stunning Escort in Ghaziabad . Every meeting guarantees absolute privacy, gorgeous partners, and unforgettable moments of...
on Oct 3, 2026 about How to Start an Invention Idea
모든 댓글을 읽는 데 시간이 걸렸지 만 기사를 정말 즐겼습니다. 그것은 나에게 매우 도움이되는 것으로 판명되었고 여기의 모든 댓글 작성자에게 확신합니다! 정보를받을 수있을뿐만 아니라 즐길 수있을 때 항상 좋습니다. 타잔 도메인 주소  
나는 모든 것을 확실히 즐기고 있습니다. 훌륭한 웹 사이트이자 좋은 공유입니다. 감사합니다. 잘 했어! 여러분은 훌륭한 블로그를 만들고 훌륭한 콘텐츠를 가지고 있습니다. 좋은 일을 계속하십시오.   타잔카지노    

Translate To: