Understanding where Joomla stores articles are vitally important if you are a developer and looking to work on the platform. Each content management system stores its data in slightly different ways. It makes switching between the different platforms difficult, especially if you are a developer and need to implement a new feature.
Joomla is one of the most well-known platforms in the content management space. It has a 2.8% market share, sitting just behind WordPress and Shopify, and is used by millions of websites. Getting to grips with how things work under the hood will have big benefits if you are trying to attract clients in this space.
Joomla stores articles in the jos_content table which is held in the MySQL database found on the server. You will need access to your server which is usually provided by the company that hosts your domain.
Be aware that Joomla doesn’t store attachments and other elements included in an article in the same table. These are found elsewhere.
Let’s take a closer look at where Joomla stores articles and the other elements that appear on the page.
Where does Jooma store articles?
Joomla saves the text of your articles to the jos_content table found in your website’s MySQL database. You can access the table via the cPanel provided by the company that provides your hosting service. So you won’t find the text of your articles in a folder anywhere on the server.
If you are planning to dig around in your website MySQL database I’d highly recommend making a copy of the database first. If you make a mistake you can just upload the old database and revert any changes.
SELECT * FROM #__content
To return a list of the articles on your Joomla site you can run the query above. It is asking the MySQL database to return all fields from the content table. You’ll also be able to find links and contact items on the same page.
Be aware that Joomla does not store the media and attachments for an article in the same table. If you want to access these and make a copy please follow the instructions below.
If you try to migrate a website with just the database all of the rich content like images won’t be transferred across. Make sure to follow our instructions below because Joomla articles don’t migrate across in the same way as WordPress pages.
Where does Joomla store article attachments?
You won’t find the photos, icons, and other article attachments in the database. They are stored as files on your website’s installation of Joomla. Usually, they can be found in the images/stories directory.
Unlike the article which Joomla stores in the jos_content table inside your MySQL database, images and graphics are stored in a physical file location.
Different plugins will also store their content in different nested folders and files. Or use the MySQL database as well. There is no hard and fast rule for plugins so look in the documentation for each before copying anything other. Often a look at plugins will keep files in a physical location and then store the location of the file in the database so that an article or page fan references it correctly.
Just remember that if you do backup your Joomla website you still need to copy across the database table and the physical files on the server. Otherwise, you’ll have a lot of database links pointing to non-existent media.
Copying Joomla articles from the database with MySQL
One way to guarantee that your Joomla articles are safe and secure is to make a backup of the database. When copying the database, understanding where Joomla stores its articles is simple as you’ll be able to have a copy of the specific table they are in. It’s also best practice if you are running any type of website to regularly back up the contents of the database and files.
Run mysqldump to create a database copy:
$ mysqldump -u user -p db-mydbname > db-mydbname.out
Copy db-mydbname.out file using sftp/ssh to remote MySQL server:
$ scp db-mydbname.out firstname.lastname@example.org:/backup
Restore the database on the remote server (login over ssh):
$ mysql -u user -p db-mydhname < db-mydbname.out
To import the copy of the database onto a new server you will need to create a new database on your server. It must be empty before importing and UTF8 (utf_general_ci).
Once you have created it:
- Log in to the newly created database using phpMyAdmin
- Click the new database on the left
- Click the import Rab
- Select the Browse button found under the file to import the heading
- Choose the file from your computer
- Click Go to import
Once you have completed the above copy across all of the necessary directories and folders from your old site as well. Depending on your internet speed downloading everything can take quite a while. You need to:
- Identify the files and folders you need
- Download them on your machine
- Upload them to your Joomla installation on your new server.
Check out the documentation for more information.
Understanding where Joomla stores articles are crucial to successfully migrating a site. The article text can be found in jos_content while the images and attachments will be located in physical folders on the server.
To be able to get a new website set up you’ll need a copy of the MySQL database which includes the article text. Then you’ll need to download and reupload the files and folders from the server.
Nathan Britten, the founder and editor of Developer Pitstop, is a self-taught software engineer with nearly five years of experience in front-end technologies. Nathan created the site to provide simple, straightforward knowledge to those interested in technology, helping them navigate the industry and better understand their day-to-day roles.