You might think that once the database-driven web site is created, you’ve completed the essential and all you need to do is further designing and development for leads purpose.
Factor that stimulates transportation of website server
Yes, above is right thinking and approach to craft more webpages for more visibility on internet. During course of time, suppose new web hosting package is discovered that offers extensible range of features at much cheaper price yearly.
You talked with concerned entity and decided to plan out migration of web application to transfer it on that vendor’s servers.
And now you are ready for migrating today.
What steps to follow to avoid catastrophic events that can result in loss of data ?
Before we take you on a tour of database backup process when shifting web server, there are two things to keep in mind.
- Text given herein relates to accurately backing data of database, if you wish to download stuff like images, videos, animations, slide shows etc. from a CMS, you need to do it manually or consult documentation of that CMS or component
- It is assumed that website is generated using PHP and MySQL technologies.
In a real-world situation, website owner will need time to think about the site and ask for some last-minute changes to both : new and old web hosts.
A web designer/developer cannot anticipate everything that a site owner might expect to face with a database driven web site for migration process.
Also, last-minute changes might be necessary if new laws require the company’s database to exclude or include certain information.
The standard process is executed briefly as follows.
- Making last-minute changes
- Allow members to update their own details
- Provide for safe e-mailing
- Create a secure feedback form
- Migrating the database to a remote host
- Backing up your database
Unfortunately, to understand above six steps in a detailed manner, we need to follow an elaborate example of existing website code. So, we will continue on work arounds for this steps instead getting our hands dirty with practical application.
Connection file of MySQL that you need to take care of
Special attention should be given to securely upload the mysqli_connect.php file.
For maximum security, the database connection file should reside outside the root folder so it can not be directly accessed via website.
Upload interactive pages of website to new Host ( Migration )
- Most hosts are using Linux – any flavour/variant.
There you will find an htdocs folder in the root. Use FTP client like FileZilla to upload HTML cum PHP code pages in this folder.
htdocs directory will be under public_html. If it is at different destination, consult
your provider to give you the path of htdocs.
Take care that you don’t replace true mysqli_connect.php with wrong or older version
File during this task.
- If you are changing to Windows server, upload your existing admin table’s htdocs folder into the new host’s htdocs folder.
- Upload the SQL files for the tables of public_html(htdocs) folder that you already transferred in first step.
- Log in to the new server’s control panel and open phpMyAdmin. Click on the name of newly created empty database, and then press down the button for import tab. Browse the public_html folder, inject each uploaded SQL file. You will have to eject every single file one at a time. Click on the ‘Go’.
- When opening website, we want to load index.php file as opposed to index.html. Therefore rename html version of file to old-index.html or like name. And keep index.php file as it is.
Finally, Take Backup
Now you can take regular backups with phpMyAdmin and export SQL dumps for each and every table of database. Copy them to DVD or portable hard disk rather keeping them in their place. Or you may copy them to another computer as we want both types of backup – physical and logical data files.
Continue exploring more at..
Simply to read more articles on
- web application development
- eCommerce related ideas or
- to get practical inputs or techniques to enhance your own mobile application navigate to
Bliss Web Solution Pvt. Ltd. is a top-notch web development company specializing in optimization of high traffic websites.
and we will reply you within 24 working hours.
You can freely attend weekend discussions held at our office in Ahmedabad.
Just call us on +91 98256 77818 to raise a ticket or to input new project in our system to complete it within tight deadlines of time.