Breakdown of how to clone a xibo database using mysql shell


I am trying to clone my xibo database using the shell in mysql 5.6 and i cannot for the life of me figure out what xibo actually say to do… - what xibo say to do

I am trying to do method 1 if that helps but if there is an easier explanation that would be much appreciated

Thanks in advance

That’s not overly complicated process, please let me try to give you more description.

So at a start you need to know your MySQL admin user and Xibo/db users, in this example it is as follows:
MySQL Administrative User = madmin
MySQL Xibo User = Xibodbuser
MySQL Database = Xibodb

I’ll assume that you do know your own names for the above.

Now, first command:
mysqldump -u madmin -p Xibodb > Xibo.sql

mysqldump -> it’s a command to well dump the database :slight_smile:
-u -> your MySQL admin user name
-p -> your MySQL admin user password
Xibodb > Xibo.sql - ‘your databse name’ > ‘file name to which you want to dump the database’

You’re dumping your Xibo database to Xibo.sql file which then will be used for new database in next steps.

Now that you have that, you will want to create new database using the Xibo.sql that you just created in a previous step so:

mysql -u madmin -p mysql

command(mysql) your MySQL username and your MySQL password

And then the creation:

create database Xibodb2;
grant all privileges on Xibodb2.* to 'Xibodbuser'@'localhost';
use Xibodb2;
source Xibo.sql

create database Xibodb2 - it will create empty database named Xibodb2, you can name it differently what’s important is, there must be no database with that name already existing.

grant all privileges on Xibodb2.* to 'Xibodbuser'@'localhost';
so you will want to grant privileges on your newly created database to your MySQL Xibo user

again Xibodb2 is just an example you can name it differently just remember the name and change the code accordingly
Xibodbuser - your MySQL Xibo username it might not be exactly Xibodbuser of course.

use Xibodb2;
simply database name to use

source Xibo.sql
source of the database - points to the sql file we created in point 1 (sql dump)


We did what we came here to do so we quit.

Finally as a proud owner of cloned database, you presumably want to use it in Xibo now.

So you open your settings.php in Xibo CMS folder
find the line
$dbname = '
and you enter your new cloned database name there.

I hope that will help you, if you have specific questions regarding steps here or something, let me know.

1 Like

So i get the dump command but where is the file that you wish to dump the database stored or is it just a temporary dump file?

it will be created in whatever folder you’re in so for example:

you do cd /var/www/library and then do sqldump then Xibo.sql will be saved to that folder (library)