Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Replicate website for backup  (Read 4307 times)

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Replicate website for backup
« on: August 16, 2023, 05:29:43 PM »
Hi I had my server crashed for over 5 hours and my website was down. Is there any solution in abanteCart that can handle this?
I know I can have the same code and database on a different server but again I have a question regarding that
Lets say my actual domain is domain.com and my website and database is hosted there.
I will set up a backup server name backup-domain.com and test my abanteCart over there and make sure it is working. But the URL for backup is backup-domain.com

My DNS provider does provide failover and he says I can set up failover but now my backup domain is backup-domain.com  I don't want customers to see backup-domain.com as DNS will be pointing to different IP.

So is there any way I can use same domain name in abanteCart's config file after testing it on backup server. I am confused here is there any other solution or can someone help me with this?

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Replicate website for backup
« Reply #1 on: August 17, 2023, 10:10:01 AM »
Any suggestions?

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5819
  • Karma: +274/-2
    • View Profile
Re: Replicate website for backup
« Reply #2 on: August 18, 2023, 04:06:30 AM »
Any suggestions?
Hello. If your server is crushed AbanteCart cant help you. You need to change the hosting provider

Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Replicate website for backup
« Reply #3 on: August 18, 2023, 05:09:32 PM »
I understand, but I want to replicate my code and handle it with load balancer. So lets say my original website crashes and load balancer will point it to my backup IP address. But at that backup URL would be different so I don't know how to fix that because domain name should be for real website not the backup one

main-website.com  is my original website     I copy code and database to to backup-website.com
My DNS Points to main-website.com and when it is down it points to backup-website.com   

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: Replicate website for backup
« Reply #4 on: August 18, 2023, 05:54:16 PM »
Hey there Sam_78

you can use the same domain name on different servers -  there are several ways to accomplish this and you do need to get with your hosting company to see which one will work best for you.

Here is some good basic info to see how to use the DNS on the name servers to move re allocated

https://forums.cpanel.net/threads/multiple-servers-same-domain-name-is-this-correct.707021/

Cloudflare explains Round Robin.

https://www.cloudflare.com/learning/performance/what-is-dns-load-balancing/

https://severalnines.com/blog/how-does-database-load-balancer-work/

Note:  you need to decide on how you want to keep your data in sync -  if one server is "down" or out of rotation the next one will take the db changes,  when the first one is up,  you need that info to be sync to the transactions of the one that got the info

Cheers -
The WHY2 Support team




Offline Sam_78

  • Sr. Member
  • ****
  • Posts: 270
  • Karma: +42/-1
    • View Profile
Re: Replicate website for backup
« Reply #5 on: August 21, 2023, 02:16:26 PM »
Thanks llegrand 

I read about it and this is what I understood:

From what I read is I do not test failover site I just dump my code and MySql to a separate Cpanel account and have  job that updates my Database everynight and point that IP address as Failover at my DNS, correct?

main-website.com will have Cpanel and MySQL point to 1.2.3.4 and at my DNS they check it every minute and if they dont get response they point it to failover.
Let's say my failover is at failover-website.com   and MySQL is also there but I do need to test this failover and for this failover I need to have URL in config file? correct ?

One option I can think of is to make host entry and try it locally and it should work but I just want to know how these big companies handle failover.

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1798
  • Karma: +520/-7
    • View Profile
Re: Replicate website for backup
« Reply #6 on: August 21, 2023, 03:36:42 PM »
You have pretty well understood it.  Be sure your two sites are NOT on the same machine and have different IP addresses.
the URL is the SAME for both sights -the difference is in the DNS (nameserver) which is controlled within your domain nameservers info at your registrar.

And you have picked up on the syncing issue.   As to what "big companies" do,  there are several solutions.  from simple to complex.

What kind of volume to you have? That will help you decide how much effort and cost you need to insure your info is relatively in sync.
Various solutions -  you can move your DB to one different location and let both app locations write to the same DB -  then make more frequent backups of the DB  in a location other than your site location.   eg.  if you have Softaculous you can set your backup for just the DB  and save the backup on a different location like a dropbox account or AWS if you use that.

Look into what your backup options are from your hosting company -  are you having a daily backup with several generations auto ran  and stored off your site server??   
Your hosting company should able to provide you more specific options that work within their framework

Do you get notification when your site went offline?

There is also the ability to have a hot-swap raid backup  on some hosts -  that does cost more,  but what it is two drives assigned to your account -  and they both get written to almost simultaneously,  if the main one goes down,  the hot swap is actually pulled physically and placed in a new location -  most host who provide this monitor your site and if there is a mechanically failure of a drive they do the swap  quickly.






Offline william.r

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
    • GMC SUV Models
Re: Replicate website for backup
« Reply #7 on: September 22, 2023, 12:43:53 AM »
Hey there Sam_78

you can use the same domain name on different servers -  there are several ways to accomplish this and you do need to get with your hosting company to see which one will work best for you.

Note:  you need to decide on how you want to keep your data in sync -  if one server is "down" or out of rotation the next one will take the db changes,  when the first one is up,  you need that info to be sync to the transactions of the one that got the info

Cheers -
The WHY2 Support team





Hello llegrand, thanks for sharing.
This tutorial really helpful, at this time the Cloudflare is one of the right choices to make work easier for load balancing needs.

 

Database Error

Please try again. If you come back to this error screen, report the error to an administrator.