Archive for the tag 'Restoring'

Restoring a User’s Database Access For WHM version 11.36

If a database user loses access to databases, you may be able to restore the user’s grants to the database using the restoregrants utility.

Using Restoregrants to Restore the User’s Database Access

Execute one of the following commands from the command line:

/usr/local/cpanel/bin/restoregrants –cpuser=$cpuser –db={mysql, pg} –dbuser=$dbuser
or
/usr/local/cpanel/bin/restoregrants –cpuser=$cpuser –db={mysql, pg} –all

$cpuser The cPanel username which has lost access to databases.
{mysql, pg} The type of database: mysql for MySQL or pg for PostgreSQL.
$dbuser The database user whose privileges you wish to restore.

SBDavid

Restoring Mail Configuration in Plesk

Restoring Mail Configuration in Plesk

Sometimes, Parallels Plesk Panel mail server configuration becomes corrupt and it is necessary to restore it. The restoration is carried out by internal mchk utility, intended for use by Parallels Plesk Panel.

However, as administrator, you can use it for restoring the Qmail and Courier-imap configuration when needed.

By default mchk is running in the background mode.

To execute it in the foreground, use the -v option. For example:

/usr/local/psa/admin/sbin/mchk -v

Reference : http://parallels.com/Plesk/

SBDavid

Saving and Restoring iptables Rules

Saving and Restoring iptables Rules

The iptables package comes with two more tools that are very useful, specially if you are dealing with larger rule-sets.

These two tools are called iptables-save and iptables-restore

Firewall rules are only valid for the time the computer is on; so, if the system is rebooted, the rules are automatically flushed and reset.

To save the rules so that they are loaded later, use the following command:

/sbin/service iptables save

The rules are stored in the file /etc/sysconfig/iptables and are applied whenever the service is started or restarted, including when the machine is rebooted.

#iptables-save -c > /etc/iptables-save

The above command will in other words save the whole rule-set to a file called /etc/iptables-save with byte and packet counters still intact.

Example

Save current iptables firewall rules:

# iptables-save > /root/iptables-save

To restore iptables rules:

# iptables-restore < /root/iptables-save
SBDavid

Restoring a backup in Webmin

Restoring a backup in Webmin

If you find that a config file on your system has been corrupted, incorrectly edited or mistakenly deleted, it can be easily restored using this module.

The steps to perform a restore are :

Click on the Restore now tab.

Select the module or modules whose config files you want to restore from the Modules to restore menu.
In the Restore from section, enter the path to a local or remote file that was originally created by this module.

To be useful, it must contain backups for the modules that you selected above.

Click the Restore Now button.

If all goes well, a page will be displayed showing the number of modules and files restored.

Files will be restored to their original locations on the system, rather than the paths that are set on the Module Config pages of the selected modules.