Merge old cdr with new cdr

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
I recently rebuilt my system and upgraded to 1.4. I did not restore the previous system and reconfigured everything from scratch. I did not restore the cdr immediately. Is there any easy way to restore it now and merge it with the existing cdr? Otherwise I will restore it to my backup system but I would rather have it all in one. Any suggestions?
 

The Deacon

Guru
Joined
Jan 29, 2008
Messages
296
Reaction score
14
You sure can and it's quite easy. Use the FreePBX Backup / Restore option to do that.

Just create a backup schedule and select just the CDR option, tell it that you want to run it now and you're set.

The backup files are stored on the file system at /var/lib/asterisk/backups

Move the file from the old machine to the new machine and restore it.
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
The Deacon - I was planning on doing that but the restore process says that it will overwrite the existing cdr records and I was afraid I would lose the new cdr.
 

jroper

Guru
Joined
Oct 20, 2007
Messages
3,832
Reaction score
71
Practising on VMware first, you should be able to append your CDR records to the existing asteriskcdrdb using either the command line or phpmyadmin.

Joe
 

phinphan

Active Member
Joined
Oct 19, 2007
Messages
641
Reaction score
130
Thanks Joe. That is a great idea. I will give it a try.
 

The Deacon

Guru
Joined
Jan 29, 2008
Messages
296
Reaction score
14
The Deacon - I was planning on doing that but the restore process says that it will overwrite the existing cdr records and I was afraid I would lose the new cdr.

I'm sorry, I mis-read your question. You're right. It will!

Here is a command line approach to do it:

On the old box, let's export the data (but since we just need the data, not to create a database or a table, use the -n and -t options respectively):

mysqldump -u root -p asteriskcdrdb -n -t > old_cdr.sql

Copy this file over to your new box via scp.

On the new box, let's get a quick backup of the data before we monkey with anything:

mysqldump -u root -p asteriskcdrdb > new_cdr.sql

Now, let's import the old data into the cdr database:

mysql -u root -p asteriskcdrdb < old_cdr.sql

That should do the trick!

-Rick
 

Members online

Forum statistics

Threads
25,782
Messages
167,509
Members
19,202
Latest member
pbxnewguy
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top