Convert to a Composer based concrete5 installation

If you're using a normal concrete5 installation and you want to convert it to a Composer based installation, here's what you should do.

First and foremost, make sure you have backups of the database and the files. Also, it's probably smart to test things first in a development environment.

  1. Create a new Composer based concrete5 project, see https://github.com/concrete5/composer. It's not needed to (re)install concrete5. You can either go for the latest release, or you'd go for the latest commit. If you're unsure, it's probably best to let Composer download the latest release.
  2. Copy your old 'application' directory to the 'public' folder, but don't copy the 'application/bootstrap/autoload.php' file. This is very important, otherwise concrete5 will complain with "Third party libraries not installed. Make sure that composer has required libraries in the concrete/ directory."
  3. Copy your packages to 'public/packages'.
  4. Copy other files in your former webroot to 'public', e.g. a .htaccess file.
  5. If you access your website via a vhost, make sure you change your Apache configuration and restart the webserver. The part that needs to be changed is the DOCUMENT_ROOT, which should now point to the '/public' sub directory. If you access your website via a subdirectory, just navigate to e.g. http://localhost/your-project/public
  6. If you run into issues, try clearing the cache by deleting the 'public/application/files/cache' directory.

 

For questions about how to use Composer in concrete5, make sure you join the #composer Slack channel.