ejabberd Mnesia database backup - backup

Does making an ejabberd binary backup of mnesia database from the admin panel will also back up archived messages stored in MUC archive and private chats archive? If not, how to back up archived messages?

ejabberd Mnesia backup backups all the data stored in Mnesia, so if your archive are in Mnesia they will be backuped as well.
However, like always with backup, you must test the process from backup to restore to validate that it works as expected and matches your needs.

Related

How can I automatically restore my Heroku Postgres staging database from a daily backup?

I have my Heroku production database scheduled to make daily backups, and I want to restore the backups onto my staging database daily as well. This way I can keep the staging box in sync with production for testing/debugging purposes and have a daily test of the restoration process run automatically.
I've tried to schedule a bash script to run on the staging box to perform the restore. The script I have uses the Heroku CLI to pull the url of the latest backup and perform the restoration. The problem I have is with authenticating the Heroku CLI. Since I can't open a browser on the dyno, I need to find a safe way to authenticate.
Should I pull a .netrc file from somewhere? Is it even a good idea to give a dyno the CLI? Is there a better way to go about this without standing up another server to run the restorations?
You can put an authorization token in the HEROKU_API_KEY env variable on your staging environment. Generate the token with heroku auth:token.
Then set the token on staging with heroku config:set HEROKU_API_KEY=token -a staging
From a security standpoint, this means your staging environment pretty much has full access to your production environment.
A more secure way is to have a scheduled task run on the production app or a new app just for this purpose that copies the db backup to an S3 bucket the staging app has access to. The staging app the restores from the backup in the s3 bucket. Staging needs no access to production.
This is a good idea anyway - if you lose access to Heroku you'll still have access to your backups.
There's a buildpack for this - https://github.com/kbaum/heroku-database-backups. I encourage you to read the code in the build pack - it is a pretty simple processes. I would also either fork the buildpack, or just write your own code because it will have full access to your production environment. I woud never trust a third party buildpack with that.
Bonus points if your job scrubs sensitive information from your production database for staging. It could do this by:
Restoring the production backup to second database
Scrub sensitive information from the second database
Backup the second database
Push the second database backup to the S3 bucket.

TDE on Azure SQL Managed Instance

TDE is not enabled on MI by default. I had manually enabled TDE by setting the encryption to true in the db properties. Encryption of the DB took around 20 mins and below is the output from the sys.dm_database_encryption_keys table.
How do we verify if TDE is enabled in Managed instance or not? As neither Azure provides access to automated backups of MI nor i can manually take the backup when the TDE is turned on in MI.
Would like to access the automated backups (7day backup feature) and verify the files can be restored or not. Provide the procedure.
Hoping the backups are encrypted as TDE is enabled on my DB, so how can these be decrypted as Azure is not providing any keys to decrypt.
Use the following query to find encrypted database:
select name, is_encrypted from sys.databases
You cannot directly access backup files; however, you can run point-in-time restore to verify that any previous backup can be restored as a new database (you have restore button on the portal for each database or you can use PowerShell see - https://blogs.msdn.microsoft.com/sqlserverstorageengine/2018/06/28/point-in-time-restore-of-a-database-on-azure-sql-managed-instance-using-azurerm-sql-powershell-library/)
Point-in-time restore is the only way to restore encrypted automatic backups and Azure automatically de-crypts the backup on restore. You cannot restore backup from MI on SQL Server because MI is always higher version than SQL server. Therefore, even if you de-crpt the backup file you cannot use it on SQL Server, and if you want to restore it on Managed Instance, MI will find the key.

How do backups work in DirectAdmin?

I'm sure there's a good amount of developers here that use DirectAdmin and I had a quick question.
I've always used cPanel and I'm not on a server that is using DirectAdmin instead. Where in DirectAdmin can you generate a full backup of the account at the user level?
Also, do DirectAdmin backups include everything related to the account like cPanel backups do? For example, not only the files and databases but also the cron jobs, DNS zones, email accounts, etc.?
And where are the backups stored by default? Is there an option to send the backups to a remote server via FTP like you can with cPanel?
There are two different backup systems built into DA:
Admin Tools | System Backup. This tool lets you backup configuration data and arbitrary directories, locally or using FTP or SCP.
Admin Tools | Admin Backup/Transfer. This tool is oriented toward backing up data account by account, in one archive per account, in a format that you can use to restore from (in the same tool) on the original or another DA server (i.e. if you want to transfer to a new server). You can back up locally and/or via FTP.
Both options can also be scheduled via cron.
Depending on your level of access, only one of these might be available to you. This page has further info for non-administrators: http://www.site-helper.com/backup.html.
You can improve your DirectAdmin backup with an incremental backup plugin that includes local and remote backup location, please check the setup guide here

Backing Up SQL Server To Cloud?

To start i dont have much experience with DB's. In summary, i have an application for a client. They dont want to necessarilary host their DB online but have a local sql server set up for their 2 computers.
I have a batch script that backs up the database every night. Is there a way in the batch script to send them to the cloud like a skydrive,etc?
Try our SQLBackupAndFTP software. You can schedule backup jobs with SQLBackupAndFTP (full, differential and transaction log backups), save backups at local folders, FTP, Dropbox, Box, Google Drive, Amazon S3, SkyDrive, delete old backups and configure email notifications... Basic features are available in free version or you can try all features in trial mode.
Just backup to SkyDrive folder. If DB is big use rsync for sending to cloud or do full backups every week, differential every day and transaction every hour (depending of you application etc) then there will be less data to send to cloud.
backup database to SD folder - using backup compression (if available in your edition of sql server, see WITH COMPRESSION clause of BACKUP statement help in BOL) or using 3rd party backup compression tool (either free or paid)
also you can backup database to temporary folder and then zip it to SD folder
If you are willing to spend a bit of money, cloudberry has an sql backup tool that will do exactly that (and more).
http://www.cloudberrylab.com/sql-backup-amazon-s3-azure.aspx

SQL server backup restore issue

Asking this question for a friend of mine.
My client had send me a Back up file of a database in SQL Server 2008.
I installed SQL Server 2008 Express Edition.
Then i tried to Restore the given Back file with this but unfortunately its throwing an error
"The media family on device is incorrectly formed . SQL Server can not process this media family.RESTORE HEADER ONLY is terminating abnormally .(Microsoft SQL Server, Error 3241)"
I searched for this error and evry where they says may be the back up might be corrupted.
But my client is able to restore the same at their end.
Any idea?
Have you applied the latest service packs to your copy of SQL Server 2008? Try that, and then do a RESTORE HEADERONLY command in Sql Enterprise manager. That will give you the properties of the file you're trying to backup. Is your client using Express Edition as well?
It is possible that the backup file became corrupt during transit.
I would suggest that the client either:
re-send the database backup file
or create another one.
It may also be pertinent to suggest to the client that when creating the Database Backup they use the CHECKSUM option to validate the contents of the backup file that is produced.
CHECKSUM
Enables backup checksums, so that BACKUP can do the following:
Prior to writing a page to the
backup media, BACKUP verifies the
page (page checksum or torn page),
if this information is present on
the page.
Regardless of whether page checksums
are present, BACKUP generates a
separate backup checksum for the
backup streams. Restore operations
can optionally use the backup
checksum to validate that the backup
is not corrupted. The backup
checksum is stored on the backup
media, not on the database pages.
The backup checksum can optionally
be used at restore time.
References
SQL Server Books Online - Backup Database