Knowledgebase

How To Backup and Restore Cpanel Accounts via SSH ?

1: Log-in to the SSH as Root user.

2: Enter the following command string on the command line interface:

/scripts/pkgacct username . –store in current location

Note: The account backup will be created in the current directory you are in

How to Restore the Individual cPanel Account via SSH?

Step 1: To restore the cPanel account backups, enter the following command

/scripts/restorepkg username

How to Reset MySQL root Password on CentOS ?

There will be times when the root password for your MySQL instance is either forgotten or compromised. This calls for you to reset the root password.

The follwing steps will walk you through how to reset the root password for MySQL.

Stop the MySQL process

$ service mysqld stop

Once MySQL has stopped

Restart it with the –skip-grant-tables option

$ mysqld_safe –skip-grant-tables &

Connect to MySQL using the root user.

$ mysql -u root

Once logged in, you should see the following prompt:

mysql>

Tell MySQL which database to use:

mysql> use mysql;

Enter the new password for the root user as follows:

mysql> UPDATE user SET password=PASSWORD(“YOUR NEW PASSWORD HERE”) WHERE User=’root’;

Flush the privileges:

mysql> flush privileges;

Exit MySQL:

mysql> quit

Now stop MySQL again:

$ service mysqld stop

Now restart MySQL and test your new login.

$ service mysqld restart
$ mysql -u root -p

How to import and export mysql database via ssh ?

1. IMPOTR: mysql -u user -p –default_character_set utf8 your_db < backup.sql

2. EXPORT: mysqldump -u root your_db > backup.sql

3. IMPORT: mysql -u root your_dbnew < backup.sql

4. IMPORT: mysql -u DB_User -p Db_Password -P port -h Host Name < path of database file to import

How to upgrade MySQL 5.5 to 5.6/5.7 or MariaDB 5.5 to 10.0/10.1/10.2 on Linux ?

      1. Create a backup of all databases with the following command:

        # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysqldump -u admin –all-databases –routines –triggers > /tmp/all-databases.sql

      2. Stop the MariaDB service:

        # service mariadb stop

      3. Remove additional packages like mariadb-bench:

        # rpm -e mariadb-bench

      4. Copy a databases directory in a separate folder like this (for backup purposes also):

        # cp -a /var/lib/mysql/ /var/lib/mysql_backup

      5. Configure MariaDB repository: open the Setting MariaDB repositories page, select OS distro, release and MariaDB version to see the configuration that should be added to /etc/yum.repos.d/MariaDB.repo file. Example for MariaDB10.1:

        [mariadb]
        name = MariaDB
        baseurl = http://yum.mariadb.org/10.1/centos7-amd64
        gpgkey = https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
        gpgcheck = 1

      6. Perform an upgrade with:

        # yum install mariadb

      7. Start the MariaDB service:

        # service mariadb start

      8. Execute this command to update the package version inside Plesk:

        # plesk sbin packagemng -sdf

        Note: After an upgrade to 10.1 version, there may appear ‘mysql’ init script. It can be removed:

        # rm /etc/init.d/mysql
        # systemctl daemon-reload

How to remove remove Wordfence manually from wordpress website ?

1. Remove extended protection manually [Learn more]
2. Remove the “wordfence” plugin folder located in wp-content/plugins
3. Remove the wflogs folder located in wp-content
4. Remove wordfence-waf.php located in the root of you WordPress installation
5. Remove all Wordfence related database tables from the database, using for example phpMyAdmin.

Wordfence 7 Tables
wp_wfBadLeechers
wp_wfBlockedCommentLog
wp_wfBlockedIPLog
wp_wfBlocks (Legacy)
wp_wfBlocks7
wp_wfBlocksAdv
wp_wfConfig
wp_wfCrawlers
wp_wfFileChanges
wp_wfFileMods
wp_wfHits
wp_wfHoover
wp_wfIssues
wp_wfKnownFileList
wp_wfLeechers
wp_wfLockedOut
wp_wfLocs
wp_wfLogins
wp_wfNet404s
wp_wfNotifications

wp_wfPendingIssues
wp_wfReverseCache
wp_wfScanners
wp_wfSNIPCache
wp_wfStatus
wp_wfThrottleLog
wp_wfVulnScanners