Answer the question
In order to leave comments, you need to log in
How to deploy a local copy of Bitrix for development?
Given: Production server with bitrix-vm, access to it via ssh and access to the admin panel.
Task: deploy a local copy on your PC (OS - Ubuntu) in order to run the project locally, make improvements, and then upload the result back to the prod.
What is the best way to do this?
I'm used to all sorts of gits, branches and other things and have never worked with Bitrix before.
Answer the question
In order to leave comments, you need to log in
Once you are used to git, what are the problems?
First, set up git on the battlefield (as I understand it, you already have it). I advise you to add the Bitrix core to gitignore (if you want it under the git, it’s better to make your own repository for it. As well as configuration files:
/bitrix/php_interface/dbconn.php and /bitrix/.settings.php. In addition, .htaccess is possible, but here only if there is a need: in the regular case there is nothing server-dependent there, but if, for example, you have a test server and it is closed by Apache means, as a result, this is written in htaccess, so it must be excluded...
Next, make a backup at the battle... And deploy it locally using the restore.php script (the link to it is in the backups) from this backup. Next, in the git, you specify the battle repository, and if there is, the test server repository.
It's more of a deployment question. Because most often it is allowed to edit files during a battle (by the way, it is forbidden on large projects). those. downloading updates in several stages: commit locally to a certain development branch, go to battle, commit changes there, upload to your master, merge the master into the development branch and push it to battle. Further on the battle, already merge this branch of yours into the master.
Those. the message is that conflicts must be resolved locally.
Of course, in the ideal, the ban on editing files on the battlefield, and through the repository bar.
If there is a problem with ssh access, I can offer a module for working with git from the admin panel (from the Bitrix marketplace).
Also, though a long time ago, I wrote an article . All hands will not reach to correct. But it seems that here I indicated moments that are not there, but which you need to pay attention to
If the question is in the deployment of Ubuntu, then you need to install VM workstation and a virtual machine with Ubuntu on it ... enable NAT in the hypervisor settings and there will be access from the virtual machine to the network, if necessary.
It unfolds just like any other site. Base dump, copy of files.
In a ready-made LAMP environment (vagrant scotchbox, for example), it rises without problems.
In the database, you need to create a user from bitrix/php_interface/dbconn.php
After raising it in the admin panel, start checking the bitrix/admin/site_checker.php settings - it will tell you what else needs to be tweaked in php.ini
Deployment is more difficult: Bitrix is a file CMS, and admin can change something in the files while you are making your edits. Naturally, in any gits, even if you start them, this will not be reflected. You need to carefully...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question