Answers.Body: <p>I'd started from cleaning up &quot;vendors&quot; and running &quot;composer update&quot;.
  If not work, re-install CiviCRM would.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-21T06:23:24.547Z
Answers.Text: thank you for the idea.  I have ran a composer update and it has not made a change. I am not sure what you mean by re-install CiviCRM. I cannot lose my database.  Thanks!
Answers.UserDisplayName: Josh
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-21T16:59:18.613Z
Answers.Text: @Josh you won't be losing the database on re-install: just make a backup, install a fresh civcrm using another , empty database, then plug in your current db from the backup.
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-20T09:41:00.283Z
Answers.LastActivityDate: 2023-10-20T09:41:00.283Z
Answers.UserDisplayName: yurg
Answers.Body: <p>I had to configure the <a href="https://github.com/civicrm/cv?tab=readme-ov-file#bootstrap" rel="nofollow noreferrer">CMS Bootstrap</a> by adding an environment variable:</p>
  <pre><code>CIVICRM_BOOT=Drupal8://full/path/to/web/directory
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-10-20T03:50:58.097Z
Answers.LastActivityDate: 2024-10-20T03:50:58.097Z
Answers.UserDisplayName: IanEdington
Body: <p>I am trying to move CiviCRM and Drupal to a new server.  Everything looks to me like it should be right. I know that Drupal can connect to its database and is able to run simple drush commands. However if I try and run cv sql or cv flush I get a fatal error.</p>
  <p>Class &quot;ComposerAutoloaderInitDrupal8&quot; not found</p>
  <p>The error points to the file Drupal8.php line 414.</p>
  <p>I am using the command line because I have multiple problems with the setup that are not allowing Apache to load the page and I am trying troubleshoot.  Of course this is probably part of the problem.</p>
  <p>I have the following:</p>
  <p>PHP: 8.0.30
  Drupal: 9.5.11
  CiviCRM: 5.64.3
  CIVICRM_ROOT_PATH:  /var/aap/current/vendor</p>
  <p>I am not sure what other relevant information I can provide.</p>
  <p>Thanks!</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-21T20:37:49.830Z
Comments.Text: Okay, I found the issue.  I thought the path needed to be /vendor rather than my document root.
Comments.UserDisplayName: Josh
Tags: <drupal-9><cli>
Title: CiviCRM Cannot Find Class
ThreadText: # CiviCRM Cannot Find Class
  
  (Asked by: username_0 on 2023-10-20)
  
  I am trying to move CiviCRM and Drupal to a new server. Everything looks to me like it should be right. I know that Drupal can connect to its database and is able to run simple drush commands. However if I try and run cv sql or cv flush I get a fatal error.
  
  Class "ComposerAutoloaderInitDrupal8" not found
  
  The error points to the file Drupal8.php line 414.
  
  I am using the command line because I have multiple problems with the setup that are not allowing Apache to load the page and I am trying troubleshoot. Of course this is probably part of the problem.
  
  I have the following:
  
  PHP: 8.0.30
  Drupal: 9.5.11
  CiviCRM: 5.64.3
  CIVICRM\_ROOT\_PATH: /var/aap/current/vendor
  
  I am not sure what other relevant information I can provide.
  
  Thanks!
  
  **Tags:** drupal-9, cli
  
  > **Comments:**
  > **username_0**: Okay, I found the issue.  I thought the path needed to be /vendor rather than my document root.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-10-20. Score: 0
  
  I'd started from cleaning up "vendors" and running "composer update".
  If not work, re-install CiviCRM would.
  
  > **Comments:**
  > **username_0**: thank you for the idea.  I have ran a composer update and it has not made a change. I am not sure what you mean by re-install CiviCRM. I cannot lose my database.  Thanks!  
  > **username_1**: @username_0 you won't be losing the database on re-install: just make a backup, install a fresh civcrm using another , empty database, then plug in your current db from the backup.  
  
  ---
  
  ### Answer by username_2 on 2024-10-20. Score: 0
  
  I had to configure the CMS Bootstrap by adding an environment variable:
  CIVICRM_BOOT=Drupal8://full/path/to/web/directory
  
  
  ---
  
  