X-Payments:Codebook regeneration
The regen-codebook.php script is used to re-create the codebook contained in the <lib/XPay/Model/Codebook.php> script.
When you run this script, it will also change:
- the PIN-codes table,
- cardholder data encryption keys,
- online store keys,
- the 'force to change password' flag for all user accounts (including the Administrator).
since this information is encrypted using the codebook.
Note: Before using the script, make sure that SSH and CLI SAPI are available on your server. Contact your hosting provider regarding the matter.
To re-generate the codebook please follow the below steps (do it carefully in order to avoid losing data):
- Copy the file <lib/XPay/Model/Codebook.php> to the file <lib/XPay/Model/Codebook.prev.php>
- Create your X-Payments' database dump.
- Log in to the server via SSH.
- Go to the X-Payments installation directory, for example
$ cd /home/www/xpayments
- Run the regen-codebook.php script with two parameters -run and <xpayments_dir>, where <xpayments_dir> is the full path to the directory where your X-Payments intallation is located, for example:
$ php regen-codebook.php -run /home/www/xpayments
- If the script failed, copy the file <lib/XPay/Model/Codebook.prev.php> to the file <lib/XPay/Model/Codebook.php>, restore the database from the saved dump and repeat step 3.
- If the script completed successfully delete the database dump file and the <lib/XPay/Model/Codebook.prev.php> file.