Change table prefix on WordPress installation

If you already have a WordPress installation and you want to change the table prefix, you have to set it into wp-config.php

You have also to dump your db, replace all wp_ with newprefix_ in the sql file, remove all the tables and restore the sql file.

Now check inside newprefix_usermeta and newprefix_options tables if there are ^wp_ values and change wp_ with _newprefix

SELECT * FROM newprefix_options WHERE option_name LIKE ‘wp_%’

SELECT * FROM newprefix_usermeta WHERE meta_key LIKE ‘wp_%’

https://www.wpwhitesecurity.com/you-do-not-have-sufficient-permissions-to-access-this-page-fix/

How to start VirtualBox virtual machines via CLI and without windows around

To start a machine headless (without the VirtualBox windows around) use

$ VBoxManage startvm centos1 –type headless

where centos1 is the name of my virtual machine. To list all the virtual machines use

$ VBoxManage list vms

This works on Windows with cmd too, but you have to move to the VirtualBox directory at first, like this

cd C:\Program Files\Oracle\VirtualBox

VBoxManage modifyhd “C:\Users\Chris\VirtualBox VMs\Windows 7\Windows 7.vdi” –resize 81920

Restore a Drupal backup

If you try to backup a Drupal site you’ll have an archive with all the stuff you need to restore. Extracting it you’ll find a folder named www in which all the needs are stored: a file named database.sql that is the db dump and a docroot folder with all the files.

At first we have to create a new database and restore the dump in it. After that move the www directory in the webserver dir.

I’m restoring on my test machine so I have many sites in my webroot accessible like this http://mylocaltest/sitename and the standard htaccess must be modified: find the line with RewriteBase / and comment it adding a # at the beginning of the row.

To login go to http://mylocaltest/sitename/user.

There may be permission errors about streaming of files or something like that. To fix them you have to allow your webserver to write in the following dirs:

  • sites/default/files
  • sites/default/files/Privati
  • tmp

If you want you can change them from http://mylocaltest/sitename/admin/config/media/file-system.