Oldatabase is a Joomla administrator component for inspecting and managing the site's configured database. It embeds the Database interface, connects using the credentials in Joomla's configuration.php, and adds Joomla-specific access control, safety options, snapshots, audit logging, and workflow tools. It does not provide an independent database login or let users connect to an arbitrary server.
Warning: Database tools can permanently change or delete site data. Take and verify an independent backup before performing maintenance or edits. Oldatabase snapshots are useful recovery points, not a replacement for a tested backup and recovery plan.
Requirements
- A working Joomla administrator installation.
- Joomla session metadata enabled. In System → Global Configuration → System, enable Track Session Metadata.
- A writable Joomla database, log directory, and filesystem location for snapshots if you plan to use those features.
- A MySQL/MariaDB Joomla database supported by the bundled Database interface.
If session metadata is disabled, Oldatabase displays an error and does not open the database interface.
Install and open
- Install the Oldatabase component package using Joomla's extension installer.
- Enable session metadata as described above.
- Sign in to the Joomla administrator with a Super User account.
- Open Components → Oldatabase.
On first use, the component creates the #__oldatabase_tokens handoff table if it does not already exist. The component verifies the user's global core.admin permission on each request; granting component-level permissions alone does not grant access. A short-lived, single-use token and browser-bound cookie are used to hand the authenticated Joomla administrator session to the embedded interface.
Database interface features
The embedded Database screens provide the following tools, subject to the database server version, permissions, and the operation being allowed by Oldatabase's safety gate:
Database and table overview
- Browse the configured database's tables and views.
- See table status information such as engine, collation, comments, row estimates, data size, index size, and free space where the server provides it.
- Search the table list for tables containing a value.
- Sort and filter records, use conditions and ordering, and navigate result pages.
- See a Largest tables list on the database overview, with estimated size and row count for up to ten tables.
- Filter the table sidebar by name. The filter is remembered for the current browser session.
Browse and edit records
- Open table records and inspect field values.
- Insert, edit, clone, and delete records where database privileges allow it.
- Filter rows by field values,
NULLvalues, or comparisons between columns; select sort columns and control result limits. - Use supported field functions and values when editing, including handling for common structured, binary, date/time, enum, and set fields.
- View JSON values in a formatted form; JSON fields in edit forms can be formatted or compacted and are checked for valid JSON before submission.
- Export query results in the formats offered by the Database interface.
Schema and maintenance
Where supported by the server and database permissions:
- Create, alter, and drop tables; add, change, or remove columns.
- Configure column types, defaults, nullability, auto-increment, comments, indexes, foreign keys, table engine, collation, and supported partition settings.
- Browse and create supported views, and inspect other supported database objects.
- Run table maintenance operations such as analyze, optimize, check, repair, truncate, and drop. Availability depends on the database engine.
- Move or copy selected tables to another available schema or database when the MySQL account permits it.
- Inspect supported triggers, routines, events, server variables, server status, and the process list. Available details depend on server permissions.
The gate intentionally blocks database/server account administration and mutations to unsupported objects or operations. In particular, user/role and privilege changes, database-level DDL, stored routine/event changes, and operations whose effects cannot be safely snapshotted are not supported. REPAIR TABLE is limited to MyISAM, Aria, Archive, and CSV tables.
SQL editor
- Execute SQL and review results, errors, affected rows, and execution time.
- Review recent SQL history and reload previous statements.
- Export query results in a supported format and, when available, inspect an execution plan.
- Import SQL from uploaded files (including compressed files where supported by the server configuration).
- Use Find in SQL to search and replace text within the SQL editor.
- Use Joomla queries to insert example queries for content, checked-out items, users, extensions, database health, schema versions, cleanup, and scheduled tasks. These are starting points, not automatic actions; review each query before executing it.
The query presets include examples for finding articles and menu links, reviewing or checking in locked content, inspecting Super Users and blocked accounts, listing installed extensions and available updates, finding large tables, checking server/database character sets, reviewing Joomla schema versions, cleaning up old sessions or action logs, and reviewing scheduled tasks and their logs. Some presets change data; normal Oldatabase read-only, core-table, password re-prompt, snapshot, and audit checks still apply.
Database-changing SQL is subject to the same checks as form-based changes. The query must have a safely identifiable target when Joomla core-table protection is enabled; ambiguous or unsupported writes are blocked.
Import and export
- Import SQL files through the database interface, subject to upload limits imposed by PHP and the web server.
- Export databases, tables, and query results using the formats and output options supported by the server and Database interface.
- Use Back up database for a dated, compressed
.sql.gzdownload of the full Joomla database. The file is downloaded by the browser; store it securely. - Use the Export separately option in destructive table confirmations to download selected tables before proceeding.
- The export screen includes table sizes when the server provides them.
An export is a user-downloaded file; it is separate from Oldatabase's server-side snapshots described below.
Oldatabase options
Open the component options from the Oldatabase toolbar. Options apply to the Joomla database connection.
| Option | Default | Description |
|---|---|---|
| Interface style | Classic | Select Classic or Modern appearance. The interface follows the Joomla administrator's light or dark color scheme. |
| Read-only mode | Off | Blocks database-changing requests. Browsing, exports, and eligible read-only SQL queries remain available. |
| Protect Joomla core tables | On | Blocks changes to recognized Joomla core tables. Ambiguous SQL write targets are blocked rather than treated as safe. |
| Allowed IP addresses | Empty | Optional exact IPv4/IPv6 addresses or CIDR ranges. Empty means no IP restriction. |
The IP allowlist checks the direct client address (REMOTE_ADDR); forwarded proxy headers are ignored. Configure the trusted proxy and network so the address received by Joomla matches the address or range in the allowlist. Enter one IPv4/IPv6 address or CIDR range per line. Invalid allowlist entries fail closed.
Safety controls
- Only a Joomla administrator with global
core.adminaccess can use the component. Losing that permission invalidates access. - The database credentials come from Joomla configuration and are not exposed as a login form in the embedded interface.
- The embedded Database entry point runs the authorization gate before loading the database application. Other files in its directory are denied direct web access by the included
.htaccessrules where Apache honors them. - Read-only mode rejects database-changing requests on the server and marks the MySQL session read-only. Eligible SQL is limited to a single
SELECT,SHOW,DESCRIBE,DESC, orEXPLAINstatement; locking reads, outfile/dumpfile output, and multi-statement queries are not read-only. - Core-table protection applies to recognized Joomla core tables based on the configured table prefix. For SQL, the gate requires a target it can safely identify; otherwise it blocks the write. This protection is not a substitute for database privileges or backups.
- High-impact actions, including destructive operations, imports, and mutating SQL, ask the user to re-enter their Joomla password.
- Supported database mutations create a pre-change snapshot and write an audit event before continuing when they target the Joomla database. If required safety steps fail, the mutation is blocked. Unsupported or ambiguous operations are blocked rather than bypassing those steps.
- Drop and truncate actions have an additional confirmation dialog that offers the option to export selected tables first.
- The database account's grants control which other databases appear as move/copy targets. Oldatabase snapshots cover the Joomla database only, so do not assume a move or copy involving another database is fully covered by those snapshots; take a separate backup of any other database involved.
Joomla article search and replace
On the SQL screen, Search and replace articles can search the Joomla #__content table's intro text, full text, or both:
- Enter the text to find and its replacement, then choose the fields.
- Select Preview matching articles and inspect the resulting IDs and titles.
- Select Replace in articles to replace every exact, case-sensitive occurrence in matching records.
Replacement is disabled in read-only mode and while core-table protection is enabled. Turn off core-table protection in component options before using this tool, and ensure the database is backed up. A pre-change snapshot is created before the update, and Oldatabase asks for and verifies the Joomla password again.
Snapshots and restore
The Snapshots & restore manager is available for the Joomla database only. It supports manual snapshot creation, restore, and deletion. Snapshots are also created automatically before supported database mutations.
Snapshots are compressed and stored outside the Joomla web root in a .oldatabase-snapshots directory next to that root. The PHP process must be able to write to the directory. Snapshot files are created with restrictive permissions; protect the directory from access by other system users and include it in your backup and retention procedures as appropriate.
Snapshots include table definitions and data, triggers, and views. Stored routines and database events are not included. Before restoring, Oldatabase requires the Joomla password and creates another snapshot of the current database. Restore replaces all current tables, triggers, and views, including protected Joomla core tables; it is unavailable in read-only mode. Snapshot retention and deletion are manual. Uninstalling the component does not remove the snapshot directory.
Audit log
The Audit log screen displays recent Oldatabase events. The full log is written to oldatabase.php in Joomla's configured log directory. Events include access and mutation metadata, the client IP, and user ID; SQL statements and row values are not stored. Log retention is managed separately through the Joomla log directory.
Uninstall
Uninstalling the component drops the #__oldatabase_tokens table. It does not delete the snapshot directory or Joomla's oldatabase.php audit log. Remove those separately if appropriate for your retention policy.
