Explore information related to restore


PostgreSQL backup failed in Web help desk - Fix it Now ?


This article covers methods to resolve PostgreSQL database and fix PostgreSQL error. It may be necessary to create a backup and restore your Web Help Desk database.

This is how to back up and restore the Web Help Desk 12.x PostgreSQL embedded database. The process involves creating a backup from the web interface and restore using the embedded pgAdmin application on the Web Help Desk.

Read More



Monitor MongoDB with Nagios XI - How to perform this ?


This article covers  how to monitor a MongoDB server with Nagios XI using the MongoDB Server Configuration Wizard in order to monitor the health of your server. The

wizard supplies checks to monitor the following: number of queries per second, memory usage, the number of databases on the server, and percentage of free connections available.


To Connect to MongoDB with the appropriate privileges:

Connect to mongod or mongos with the privileges specified in the Prerequisites section.

The following procedure uses the myUserAdmin created in Enable Access Control:

mongo --port 27017 -u myUserAdmin -p 'abc123' --authenticationDatabase 'admin'

The myUserAdmin has privileges to create roles in the admin as well as other databases.


To Modify Access for an Existing User in MongoDB:

  • You must have the grantRole action on a database to grant a role on that database.
  • You must have the revokeRole action on a database to revoke a role on that database.
  • To view a role's information, you must be either explicitly granted the role or must have the viewRole action on the role's database.

Read More



Service Not Listed in WMI Wizard in Nagios - Fix it Now ?


This article covers methods to tackle Service Not Listed in WMI Wizard in Nagios. Basically, Service may not get listed in WMI Wizard in Nagios due to reasons like lower value of Truncate Output Length or insufficient permission of the user account. Windows Management Instrumentation (WMI) is a part of Windows operating systems and can provide management data and operational information about those system. WMI can be used to automate administrative tasks on remote Windows-based computers. Nagios Core and Nagios XI are capable of monitoring Windows machines via WMI. .


To Check the permissions of the files, use this command:

ls -ls /tmp/*.state

Here you can see that the root user/group is the owner of the file:

-rw-r--r-- 1 root root 91 Apr 24 16:10 /tmp/cwpss_checkcpu__1025143___.state

The simplest option is to delete the files with this command:

rm -rf /tmp/*.state

Read More



WMI Monitoring With Nagios - How to do it ?


This article covers how to monitor Windows machines with Nagios XI using WMI.

Basically, to set up WMI monitoring with Nagios, we need to configure A WMI User Account On The Windows Machine and then set up the WMI permissions. Windows Management Instrumentation (WMI) is a technology that allows for agentless monitoring of Windows servers and workstations.


Benefits of WMI Monitoring With Nagios:

  • Increased server, services, and application availability.
  • Fast detection of server and operating system failures.
  • Fast detection of service and application failures.
  • Agentless monitoring.

Read More



Alerting On Log Events With Nagios Log Server


This article covers Alerting On Log Events With Nagios Log Server. Basically, for alerting on Log Events with Nagios Log Server one needs to be familiar with the options available.

With this guide, you will learn how to create various alerts in Nagios Log Server, such as sending

them to a Nagios XI or Nagios Core monitoring server using Nagios Remote Data Processor

(NRDP), sending an email, sending SNMP traps and executing scripts.

Read More



Send test SNMP trap in Nagios - How does this work ?


This article covers how to send a trap to Nagios server to test SNMP Trap functionality.

Basically, when troubleshooting an SNMP Trap issue, it can be very helpful to remove the actual device that could be causing problems and use the snmptrap command instead.

So in this guide, you will learn all the methods of sending a trap to your Nagios server to test SNMP Trap functionality.


SNMP Trap Definition

The following trap definition can be placed in /etc/snmp/snmptt.conf which will allow the test traps sent above to be passed through to Nagios:

EVENT netSnmpExampleHeartbeatRate .1.3.6.1.4.1.8072.2.3.0.1 "netSnmpExampleHeartbeatRate" Normal
FORMAT SNMP netSnmpExampleHeartbeatRate
EXEC /usr/local/bin/snmptraphandling.py "$r" "SNMP Traps" "$s" "$@" "" "netSnmpExampleHeartbeatRate"


The default SNMP Trap configuration is stored in the /etc/snmp/snmptrapd.conf file and contains just two lines:

disableAuthorization yes
traphandle default /usr/sbin/snmptthandler

Read More



Recover orphan innodb database from ibd file - How to perform this task


This article covers how to recover the orphan InnoDB database from the ibd file. 


Orphan InnoDB database incident mostly happened when:

1 – user accidentally remove ibdata1 file. (mostly in /var/lib/mysql/ibdata1).

2 – ibdata file courrupted.


To Recover Orphaned InnoDB Tables:

1. Restart the MySQL service to recreate ibdata1, then take a backup of your database folder.

2. Login to MySQL.

3. Create a dummy database with the same name. Then, create a dummy table with the same name as the corrupted one (don’t mind the table structure for now).

4. Stop the MySQL service, copy the .frm file from the backup you took to replace the .frm file.

5. Start MySQL and have a look at the structure of your table - it should now be in place! However, don’t get too happy yet.

6. Issue a SHOW CREATE TABLE statement and copy its contents, then create the table with them.

7. Stop MySQL, copy the .ibd file from the backup directory to /var/lib/database_name and replace the existing .ibd file from the dummy table.

8. Now it’s time for Percona’s tools to shine - download and install the Percona Data Recovery Tool for InnoDB , then run the following (here -o represents the full location of your ibdata1 file, -f represents the full location of your .ibd file, -d represents the database name and -t represents your table name):

ibdconnect -o /var/lib/mysql/ibdata1 -f /var/lib/mysql/database_name/table_name.ibd -d database_name -t table_name

9. Now, run a checksum check against InnoDB - make sure you get no error messages (you might need to run this tool several times):

innochecksum /var/lib/mysql/ibdata1

10. Finally, you should be good to go - simply start MySQL.

Read More



DirectAdmin error is not a valid username


This article covers tips to resolve DirectAdmin error: is not a valid username which happens if the username length of the account is larger than the value set in the DirectAdmin configuration file.
To fix DirectAdmin Admin Backup/Transfer restore error with no details,  try to restore to a number than 10 characters.
You have to edit directadmin configuration and set this variable.
[root@mx ~]# vi /usr/local/directadmin/conf/directadmin.conf
then edit max_username_length to larger value. I my example 20.
max_username_length=20

Read More



MySQL error log cPanel


This article will guide you on more information about MySQL error logs and methods to resolve its errors. 

You will learn how to fix MySQL errors, crashes and other unexpected behavior from #MySQL. 

To view mysql error logs:

1. edit /etc/my.cnf [mysqld] log=/tmp/mysql.log.

2. restart the computer or the mysqld service service mysqld restart.

3. open phpmyadmin/any application that uses mysql/mysql console and run a query.

4. cat /tmp/mysql.log ( you should see the query ).

To Clear cPanel Error Log:

1. Login to your server using an #SSH client.

2. To clear the #Apache #errors, type the following and press Enter. cat /dev/null> /usr/local/apache/logs/error_log.

3. To delete PHP error_log files, type the following and press Enter. find /home -type f -name error_log -delete.

Read More



psql to restore a text dump How to do it


This article will guide you on steps to perform  text dump restoration. Basically, psql restores a text dump in the same file format.

You can backup a single table, a #schema, or a complete database. Select the name of the backup source in the #pgAdmin tree control, right click to open the context menu, and select Backup… to open the #Backup dialog. 

The name of the object selected will appear in the dialog title bar.

In #PostgreSQL, you can restore a database in two ways:

i. Using psql to restore plain #SQL script file generated by pg_dump and pg_dumpall tools.

ii. Using pg_restore to restore tar file and directory format created by the pg_dump tool.


To Restore Postgres Database:

1. Restore a postgres database. $ psql -U erp -d erp_devel -f mydb.sql.

2. Backup a local postgres database and restore to remote server using single command: $ pg_dump dbname | psql -h hostname dbname.

3. Restore all the postgres databases.

4. Restore a single postgres table.

Read More



Duplicity restore full backup


This article will guide you on steps to perform a Duplicity-restore full backup. #Duplicity is an efficient #backup application.

#rsync is a protocol built for Unix-like systems that provides unbelievable versatility for backing up and synchronizing data. It can be used locally to back up files to different directories or can be configured to sync across the Internet to other #hosts.

Incremental Backup captures only the changes made since the last incremental backup. Saves both time and #storage space, and ensures that your backup is up to date. Differential Backup captures only the changes made since the last full backup, not since the last differential backup.

When a normal or full backup runs on a selected drive, all the files on that drive are backed up. This, of course, includes system files, application files, user data — everything. The downside of normal backups is that they take a very long time to run, and in some cases this is more time than a company can allow.

To Use Duplicity with GPG to Securely Automate #Backups on #Ubuntu:

1. Install the Prerequisite Packages.

2. Download and Install Duplicity from Source.

3. Create SSH Keys.

4. Create GPG Keys.

5. Run an Initial Test.

6. Create Your First Backup.

7. Restore a Backup.

Read More



Recover deleted items in Microsoft outlook


This article will guide you on methods to recover deleted #emails in #Outlook. This is possible by retrieving contents from the Recoverable Items folder. 

By default, the deleted #items won't be included while searching in Outlook. Actually Outlook provides you with a feature of automatically searching all folders include emails in the Deleted Items folder in each #data file.

To Recover Permanently Deleted #Hotmail Messages:

1. Go to Outlook.com and log in to your Live, Hotmail, or other Microsoft email account. 2. Select the Deleted Items folder in the left pane. 

3. Select Recover items deleted from this folder at the top of the message list. The Recoverable Items folder will open.

Read More



Database version or build from backup file


This article will guide you on how to determine the database #version or build from a #backup file.
To know what #SQL version a #database is:
The first is by using either Enterprise Manager or SQL Server Management Studio and right clicking on the instance name and selecting Properties. In the general section you will see information such as on the following screenshots. The "Product version" or "Version" gives you a number of the version that is installed.
In order to find the SQL Server version from a bak file:
1. Here is the output returned by the RESTORE HEADERONLY statement. Here you will see a DatabaseVersion column that contains the value.
2. That's how you find out from which version of SQL Server a given backup file came.

Read More



Orphaned users in SQL Server


This article will help you to identify #Orphaned #Windows #Logins and Groups in #SQL Server.
To Resolve an Orphaned User:
To map an orphaned user to a login which already exists in master, execute the ALTER USER #statement in the user database, specifying the login name.
ALTER USER <user_name> WITH Login = <login_name>; When you recreate a missing login, the user can access the database using the password provided.
To fix orphaned users for all databases in SQL Server:
1. Login with same name as user exists – generate ALTER LOGIN to map the user to the login.
2. No login with same name exists – generate DROP USER to delete the orphan user.
3. Orphan user is [dbo] – change the database owner to SA (or whatever SA was renamed to).

Read More



Backup Active Directory Domain Controller


This article will guide you on how to #backup #active #directory domain controller.
A System State backup generally includes a copy of any installed device #drivers and related files, most of the Windows directory, the #Windows #Registry, the Active Directory configuration (where applicable) and system files under Windows File Protection.
In production it is best practice to have at least 2 domain controllers per domain. If you factor in each child domain and the other domains that could easily scale up fast if you have two in each one.
To Configure Windows Backup Users on a Domain Controller:
1. Expand Active Directory "Users > Computers > Users".
2. Right-click the appropriate user who will be performing backups and click Properties.
3. On the Member Of tab, click Add to add the Backup Operators group to the User.
4. Click OK.

Read More



Backup and Restore Nagios Log Server


This article will guide you on the steps to perform #backup and #restore a #Nagios #Log #Server cluster. Taking Backup and Restore of Nagios Log Server helps not to lose any data as it is held in other instances.

Backup and recovery describes the process of creating and storing copies of #data that can be used to protect organizations against data loss. #Recovery from a backup typically involves restoring the data to the original location, or to an alternate location where it can be used in place of the lost or damaged data.

To do a backup and system restore:

1. Click Start.

2. Go to Control Panel.

3. Go to System and Security.

4. Click Backup and Restore.

5. At the Back up or restore your files screen, click Restore my files. 

6. Browse to locate the backup file. 

Read More



Instant File Initialization in SQL server


This article will guide you on how to enable Instant File Initialization (#IFI) in #SQL Server. 

Disk space reservation without initialization is called Instant File Initialization. 

To enable #database instant file initialization:

1. First, go to Start Menu and run secpol.msc to bring up Local #Security #Policy.

2. Expand the Local Policies Folder.

3. Click on User Rights Assignment.

4. Go to the Perform Volume Maintenance Tasks option and double click it.

5. Add your SQL Server Service account, and click OK.

6. Restart your SQL Server services (MUST DO).


Read More



Steps to Back Up And Restore Nagios System


This article will guide you on how to perform #Backup and #Restore of the #Nagios System are important aspects of the #administration and #maintenance of the #system. 

Backups are an important aspect of administration and maintenance of your system. They can easily facilitate the #migration of a Nagios XI #installation between a virtual server and physical server, and the design of a fail-over or #disaster #recovery instance of Nagios XI.

There are three main types of backup: full, incremental, and differential:

1. #Full backup. As the name suggests, this refers to the process of copying everything that is considered important and that must not be lost.

2. #Incremental backup. 

3. #Differential backup.

Read More



How to create bacpac file from SQL server


This article will guide you on how to export an existing #database into a #BACPAC file is through #SSMS. A bacpac is a dacpac + data, while a dacpac only contains the schema of the database.

To create a Bacpac file:

a. To #export a database using the Azure portal, open the page for your database and click Export on the toolbar.

b. Specify the BACPAC filename, select an existing Azure storage account and container for the export, and then provide the appropriate credentials for access to the source database.

c. Click OK.

To import from a BACPAC file into a new single database using the Azure portal:

1. Open the appropriate server page.

2. On the toolbar, select Import database. 

3. Select the storage account and the container for the BACPAC file and then select the BACPAC file from which to import.

Read More



Last Restore Time of SQL server database


This article will guide you on how to collect #database restoration #history. The #SQL server database last restore time can be found using the system table in 'msdb'.
We get the following database #restoration history in my environment.
i. restore_date: It shows the database restoration #date.
ii. destination_database_name: We can get the destination database name using this #column.
iii. user_name: it gives user name that performed the restoration for that particular database.

Read More



How to restore Deleted Active Directory Objects and Users


This article will put you through the steps to restore Deleted Active Directory Objects/Users. You can also right click on any unwanted change or object deletion in #Active #Directory and click “Rollback Change” to restore the change with a single-click.

Active Directory #Recycle Bin feature preserves all link valued and non link valued attributes. This means that a restored object will retain all it's settings when restored. By default, a deleted object can be restored within 180 days.

Read More



How to securely back up your Linux Ubuntu Centos and Debian Server


#Backup and #restore refers to technologies and practices for making periodic copies of data and applications to a separate, secondary device and then using those copies to recover the data and applications—and the business operations on which they depend in the event that the original data and applications are lost.

#rsync uses what is called a delta-transfer algorithm which compares files from source and destination and sends only the differences between them.


To automatically backup #files and directories in Linux:

1. archive the content. Backing up your files using tar is very simple using the following command: # tar -cvpzf /backup/backupfilename.tar.gz /data/directory.

2. create backup script. Now let's add tar command in a bash script to make this backup process automatic.


#Rsync, or Remote Sync, is a free command-line tool that lets you transfer files and directories to local and remote destinations. 

Rsync is used for mirroring, performing backups, or migrating data to other servers.

Backing up file systems means copying file systems to removable media (such as tape) to safeguard against loss, damage, or corruption. 

Restoring file systems means copying reasonably current backup files from removable media to a working directory.

Data losses can be a very frustration encounter for a server owner. To avoid such catastrophic situations in losing your website data, it is very important to do a regular backup for your server and website.

Read More




For Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on LinuxAPT.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com






Focus on your business, not your servers.

Click Here to Learn More