Interworx 3 and backup, documentation?

I open this post, for request to sombody form iworx repply and post all info available possible.

Interowrx have now scheduled and autorotation backup?

For backup all server, have some shell command? continue on the old and clasic way?

How the backup handle the resellers?

When restore, site come form reseller account and account reseller no exist, interowrx ask to create taht reseller?
Some command for skip that answer and just asme always is YES?

I apreciate all info, available soon i have to move lot of sites form iworx to new servers and want to find some easy way to move the resellers : )

Please if some shell command change, and more options are availabla when restore, please put here in this post : )

i apreciate if can put all info avilable about this, this is a feature i saty wating for long time :slight_smile:

Thankyou !

InterWorx always had the capability of scheduling backups from the SiteWorx interface. NodeWorx users will still need to use the cron interface or you can schedule it in cron from the shell.

We try to stick to the Unix philosophy of making our scripts do one thing, and do it well. So, auto-rotation isn’t a part of the command line backup utility. However, the backup command has a lot of new features, and you have more control over the the naming format of the final file, using the new --filename-format parameter (similar to PHP’s strftime). For example, the following:

--filename-format"dj-grobe-%D-%a"

would translate to backup files named:


dj-grobe-domain1.com-mon.tgz
dj-grobe-domain2.net-wed.tgz
etc, etc

So, it’s even easier now to script your own auto-rotation solution.

Yes, this is the same as in iworx 2.1.x. backup.pex --domains all

backup.pex --domains all --reseller-id=20

will backup all domains under reseller #20.

backup.pex --domains 'a.*\.net' --reseller-id=20

will backup all domains that start with ‘a’ and end in ‘.net’ under reseller #20. :slight_smile:

[QUOTE=Dj-Grobe;12153]When restore, site come form reseller account and account reseller no exist, interowrx ask to create taht reseller?
Some command for skip that answer and just asme always is YES?[/quote]

Reseller’s are uniquely identified by their email address. In the interface, you’ll have the option to “Create” the reseller from the backup file. What this does is it checks the reseller info that’s in the backup file and does the following:

  • If you specified to create the reseller during import, and the reseller email stored in the backup does not exist on the server, the reseller will be imported automatically.
  • If you specified to create the reseller during import, and the reseller email stored in the backup does exist, the account will automatically be imported under that reseller.

Similar thing happens on the command line when you use import.pex with the --create-reseller option. This makes it easy for you to restore a complete reseller account, either from the NodeWorx interface or from the command line.

Please if some shell command change, and more options are availabla when restore, please put here in this post : )

We will update the documentation as soon as possible. :slight_smile:

One point not really clear how work

If i run backup using this way:

backup.pex --domains all

This way backup resellers too? and when want restore can use the option --create-reseller

or need run on this way for all resellers om the server?
backup.pex --domains all --reseller-id=XX

Mi idea its make complete backup of all server , i make that abckups for restore ounder disaster situations like loose complete HD, and need easya dn faster way to restore all sites.
Usually for masive imports just put all backups file on folder of server to restore and run simple xsript like this:

for a in *.gz ; do
mport.pex --archive=/home/backup/$a --control-panel=iworx --ip-address=xx.xxx.xxx.xx
done

Now can run backups using backup.pex --domains all
and then restore absolutly all in automatic adding the option --create-reseller to my masive restore script?

This will backup all accounts on the box, including all reseller accounts. If you have 3 resellers with 25 accounts each, and the master nodeworx user has 25 accounts, the total number of backups would be 100 backups.

This way backup resellers too? and when want restore can use the option --create-reseller

Yes, each siteworx account backup also has the information needed to restore the reseller info. The import.pex --create-reseller parameter is what you use to import the reseller information.

This will backup all the accounts for ONLY the given reseller.

Mi idea its make complete backup of all server , i make that abckups for restore ounder disaster situations like loose complete HD, and need easya dn faster way to restore all sites.
Usually for masive imports just put all backups file on folder of server to restore and run simple xsript like this:

for a in *.gz ; do
mport.pex --archive=/home/backup/$a --control-panel=iworx --ip-address=xx.xxx.xxx.xx
done

Now can run backups using backup.pex --domains all
and then restore absolutly all in automatic adding the option --create-reseller to my masive restore script?

Yes. That should work.

Socheat i thinking about how the system work realted to reseller ad i think houston we have a problem !!

Imagine this scenario:

Whats up if i move sites form one interworx box, to other interworx box…where same reseller ID EXIST?

Sites are automatically asigned based on the reseller ID to wrong reseller, if same ID reseller exist on the server where i move?

Accounts are automatically assigned by reseller ID only if you use the --create-reseller option. Otherwise, the reseller information in the backup file is ignored. Then, you have two options:

1.) Import with the --reseller-id= option, which will import the account under the specific reseller you specified.

2.) Import without the --reseller-id option (and without the --create-reseller option), and it will automatically import under the master reseller.

perfect…
How move on interworx 3, acount from MASTER to any reselelr id i decide?

If you go to the SiteWorx > Accounts page and click Edit next to the account you’d like to move, you’ll see a Reseller: with a dropdown next to it with all the resellers on the server. Choose the dropdown you’d like to move that account to, then click the Save button

A backup-related question:

If a siteworx (or reseller) choose to do a remote backup via FTP/SSH, will the bandwidth used for this remote backup count to this user’s / reseller’s quota?

Based on waht i know…no
Anyway wait for iworx staff confirmation

Th id for resellers is the email?

Interworx not unse ID for resller based on number when restore?

Please confirm this, because i move multiple reseller from diferent servers to one common server.
If the reseller its ID number based this itsa trouble, but if reseller its mail based : ) this can be maded really faster : )

Please i apreciate if can cofirm this somebody form interworx.

I assume you are referring to the backup.pex command. When you use the --create-reseller option, it will use the email address stored in the backup file. When you use the --reseller-id <number> option, it uses the reseller ID number that you just passed in.

Ok imagine i have 2 servers, server a, where have 3 resellers, server b where have 3 resellers.

Ig i backup using domain all on both servers, and then restore an new server using command --create-reseller, all resellers are created correcltya nd sited reasigned in correct way?

[QUOTE=Dj-Grobe;12697]Ok imagine i have 2 servers, server a, where have 3 resellers, server b where have 3 resellers.

Ig i backup using domain all on both servers, and then restore an new server using command --create-reseller, all resellers are created correcltya nd sited reasigned in correct way?[/QUOTE]

Yes, that is correct.

Hi,

Now with the structure-only backup option we will be able to just backup accounts structure only and choose our own solution to backup the data itself.

Ok, but I think it’d be great if Interworx could define wth precision which data has to be backuped. Tell for one domain :

  • /home/accounts/domainname
  • /var/lib/mysql/accounts_*

Is it enough ?

I continue to think that Interworx could provide “off the record” (like here in the forum) some perl/bash/php scripts as example to backups all accounts with different methods. All know that to have a good backup and recovery plan (of interworx data ONLY, not the server itself) is one of the most important thing and I think that Interworx could help their customers to set this plan by providing some scripts (even if I know it completly depends of the need of everyone. But some examples and scripts that could help the customers to perform:- A full backup - A full import of all accounts on a new box - A full migration from a box to another - would be great for the community).

No ? don’t you agreee with this ?

Pascal

[QUOTE=pascal;12702]Ok, but I think it’d be great if Interworx could define wth precision which data has to be backuped. Tell for one domain :

  • /home/accounts/domainname
  • /var/lib/mysql/accounts_*
    [/quote]

You’ll also need to grab /home/accounts/var/domainname/mail. Structure-only backups only grab the email usernames, groups, aliases, and passwords. The actual email contents of each email account is considered data and not included in a structure-only backup. Also, if there’s any files in the top level /home/accounts/ directory, you’ll obviously want to grab that too.

Sure, here are a few examples, using backup.pex from InterWorx v.3.0…

Backup Examples
This will create full backups of every SiteWorx account on the box, and store them in each SiteWorx account’s standard location (/home/username/domain.com/iworx-backup/):

/home/interworx/bin/backup.pex --domains=all

This will create structure-only backups of every SiteWorx account on the box, and store them in each SiteWorx account’s standard location (/home/username/domain.com/iworx-backup/):

/home/interworx/bin/backup.pex --domains=all --structure-only

This will create structure-only backups and save them in a central location (/backups):

/home/interworx/bin/backup.pex --domains=all --structure-only --output-dir=/backups

This will create structure-only backups and transfer them via SCP to a remote server (as specified in the /root/my-transfer.ini file):

/home/interworx/bin/backup.pex \
--domains=all \
--structure-only \
--xfer-ini=/root/my-transfer.ini 
--xfer-method=scp

This will create structure-only backups, transfer them via FTP to a remote server (as specified in the /root/my-transfer.ini file), with the filename format of “domain.com.tgz”:

/home/interworx/bin/backup.pex \
--domains=all \
--structure-only \
--filename-format "%D" \
--xfer-ini=/root/my-transfer.ini 
--xfer-method=scp

You can then use rsync to rsync or rsnapshot to copy over /home and /var/lib/mysql to another server to grab the data files that the structure-only backup skipped. We personally use rsnapshot, and we backup mysqldump’d backups instead of the raw MySQL table files.

Import Examples

Let’s say you had a hardware failure, and you re-installed the server and the box has the exact same IPs before and after the failure. If you had all the backups in the /backups directory (one backup file per SiteWorx account), you could import all the accounts, using the IP address stored in the backup file, using a bash script like this:


for backup_file in /backups/*.tgz
do 
  ~iworx/bin/import.pex --create-reseller --control-panel=siteworx --ip-address=inifile --archive=$backup_file
done

If the IP addresses are different on the box (for example, migrating from one box to another), you would need to group the backups by IP


for backup_file in /backups/ip_group1/*.tgz
do 
  ~iworx/bin/import.pex  --create-reseller --control-panel=siteworx --ip-address=1.2.3.4 --archive=$backup_file
done

for backup_file in /backups/ip_group2/*.tgz
do 
  ~iworx/bin/import.pex --create-reseller --control-panel=siteworx --ip-address=5.6.7.8 --archive=$backup_file
done

Or, if you are migrating boxes, you could use the mass import tool, which has many new improvements to make the process much easier.

If you are importing structure-only backups, you will then need to restore the database data, copy over the web site data, and email files to the appropriate locations. Full backups, obviously, will already have imported the database, website, and email data during the import.

Thanks Socheat it should help few peoples.

Personnaly we use the full backup in a standard location (like /backups), and don’t plan to use the structure only backups as if you use it and do a rsync then a tar to save space it would be the same as a full backup in terms of usage and time (?)

But it’s true that if you have a huge backups space on a Nas or San server it could be interesting to perform a structure only backups

As you know we’ve already done few full migration from a box to another and the main problem was to manually create the reselers and attach siteworx accounts to them. We’re really happy to now have the ability to perform this directly with the backup command : Great !

If some of you plan to use the structure only backups it could be interesting to put here your scripts as example (of backups and import)

Thanks Socheat

Pascal

You can then use rsync to rsync or rsnapshot to copy over /home and /var/lib/mysql to another server to grab the data files that the structure-only backup skipped. We personally use rsnapshot, and we backup mysqldump’d backups instead of the raw MySQL table files.

Before V3 we also used Rsnapshot (which is great as you can also add a mysqldump script to it) but the import was more complicated (if you have not the same ip from box a to b for example). Now with the v3 and the structure only backups it might be interesting :slight_smile:

Do you have some example with rsnapshot for the backup and how you’ll import the accounts in a new box ?
Do you have some examples of MySQL backups script (I think it is the best method in case of your mysql server is not the same release between server A and B ) ?

It could be great to have a full script (in RPM for example) that do a full backup structure only + rsnapshot and one for importing the data !

Pascal

I personally like structure-only backups for really large accounts.

Also, it’ll be far quicker, and less resource intensive, to backup all accounts and grab the data I can’t easily backup (i.e., internal iworx data). Imagine that you have 300 accounts on your box, each between few hundred MB and few GB in size. Doing a full backup on all accounts could take a whole day to finish.

If instead you used rsync or rsnapshot to backup the data (which would be very quick after the first time it runs, since only changed files are copied), and you then did structure-only backups of all the accounts, this would finish much quicker.

But yes, you are right. There is more work to restore a structure-only backup, because after restoring the structure-only backup, you then have to copy the data over. But, at least you have the choice. :slight_smile:

I should also clarify, this is what is considered DATA:

  • Email files in /home/username/var/domain.com/mail
  • Database data in /var/lib/mysql/username_*
  • Website data in /home/username/domain.com
  • Home directory data in /home/username
  • Site log data in /home/username/var/domain.com/logs
  • Web stats data in /home/username/var/domain.com/stats

All the above will not be included in the backup when doing structure-only backups. Everything else, is considered structure (rrd graphs, crontab, ssl, usernames, passwords, etc)