powered by Jive Software

Maintenance openfire emnbedded database

dear,

does anyone has the tutorial how to maintain openfire database such as backup database,export and import contacts?

Backup - shutdown Openfire, copy c:\program files\openfire\embedded-db\ folder to a backup place.

Importing and exporting users can be done with User import export plugin http://www.igniterealtime.org/projects/openfire/plugins.jsp

does openfire can backup database periodly??

once a week or once a month??

Openfire can not backup the database. You may want to choose an external database for Openfire if you do not trust in the internal database.

PS: One does usually not need to shutdown Openfire to get a valid backup, so a daily file system backup is often enough.

i’m afraid if one day the embedded-db crash and i don’t have anything to upload again…

i prefer external database to the internal one, but i have less time to build external db such as mysqland postgreSQL

Once i’ve been told that doing online backup can miss some info, which is still in Openfire cache. Though i recall restoring database after online backups just fine. As i have to reboot my Openfire once per month because of JVM eating all memory i can do offline backup during the down time.

the embedded database will be a file stored somewhere. so if you can close open handles (shutdown openfire) you can just backup that particular file and you’re good.

EDIT: Adding the “I think” disclaimer

The embedded database consists of:

  1. A openfire.db script which stores all data since the last checkpoint. This file will only be modified during a checkpoint (checkpoints happen if the openfire.log file reaches a specific size, I think 200 MB). So one usually gets a fine backup of this file.

  2. A openfire.log file which logs all SQL statements and transactions. So if the database crashes during a transaction one could find part of the transaction in it. Anyhow the HSQLDB engine sees that the transaction commit is missing and will likely ignore the partial transaction. If this is not possible, then the Openfire/HSQLDB startup will fail and the offending - most times incomplete - line will be logged. One needs to modify the openfire.log file with an editor and remove some of the last lines or fix the offending line which is easy.

You could make some backup and restore tests:

  1. Openfire is running, users are active, create backup ‘i’
  2. Stop Openfire, create then backup ‘ii’.
  3. Restore backup ‘i’ and start Openfire.
  4. If Openfire does not start try to fix the problem. If this does not work use backup ‘ii’.
  5. Let me know if you ever need backup ‘ii’, and how often you need to fix a problem manually.

@wroot : i have tried to upload TESTINGuser , the error told me that some contacts were the same

CONTACTS20072013 - doesn’t include TESTING user

TESTINGuser - i had created TESTING user and separated it into IT groups


CONTACTS20072013.xml (39206 Bytes)
TESTINGuser.xml (39734 Bytes)

i know how to backup

back up files on c:\program files\openfire\embedded-db , we can backup them into drive d

move those files to c:\program files\openfire\embedded-db again

done

have you connected to LDAP or Active Directory? Just guessing here, but perhaps it’s telling you users already exist because it’s looking at your directory and the users are there?

@jason : what is LDAP or Active Directory?/ahahahah…i don’t understand

for instance before i backup the user contact should be like this

accounting

a

b

c

IT

d

e

f

after backup

accounting IT

a x d p

b y e q

c z f r

when i want to upload after backup the error appeared