title: Composer.lock incompatibility with actually installed versions of packages on production server
body: <p>I'm working on a project based on PHP7 and Laravel. Unfortunately, there was a problem with dependencies and package versions.</p>
  
  <p>I guessed that the previous developer working on the project started updating packages by calling </p>
  
  <pre><code>composer update 
  </code></pre>
  
  <p>on his local dev environment.</p>
  
  <p>Therefore, a new composer.lock file has been generated and everything has been pushed to the production server - however, the composer update command has not been called on the production...</p>
  
  <p>There is a problem with the incompatibility of the PHP version and other errors in dependencies.</p>
  
  <p>This is a very large project and I wouldn't like to migrate now to higher versions on the production server.</p>
  
  <p>I am currently preparing a development environment and I care about maintaining the maximum compatibility of all package versions with what is on production.</p>
  
  <p>By calling:</p>
  
  <pre><code>composer install
  </code></pre>
  
  <p>on local environment, I'm receiving a series of errors related to the incompatibility of the package versions.</p>
  
  <p>Is there any way to regenerate / restore composer.json and composer.lock based on what is currently installed on the production server? Unfortunately, at this moment composer.lock on production doesn't completely reflect the current state of actually installed versions.</p>
  
  <p>What is a safe and good way to recreate locally a cloned project from a repository on a production server - and maintain full compatibility of all package versions, the correct form of composer.json and composer.lock?</p>
  
  <p>Thanks in advance for your help!</p>