[{"data":1,"prerenderedAt":439},["ShallowReactive",2],{"Categories":3,"NavIndexCategoriesCountFooter":203,"content-\u002F2009\u002F03\u002F01\u002Fmaintaining-upgrading-drupal-installations-with-git\u002F":204},[4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,68,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202],{"category":5},"System Administration",{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},"Software Development",{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":27},{"category":27},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":5},{"category":27},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":27},{"category":27},{"category":67},"Drones & RC",{"category":69},"DIY Projects",{"category":67},{"category":72},"Photography",{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":69},{"category":67},{"category":69},{"category":69},{"category":67},{"category":67},{"category":72},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":5},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":5},{"category":67},{"category":67},{"category":72},{"category":72},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":67},{"category":72},{"category":67},{"category":138},"3D Printing - Laser Cutting - CNC",{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":138},{"category":5},{"category":138},{"category":27},{"category":27},{"category":138},{"category":138},{"category":72},{"category":158},"Photography,3D Printing - Laser Cutting - CNC",{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":5},{"category":67},{"category":5},{"category":5},{"category":27},{"category":27},{"category":27},{"category":27},{"category":27},{"category":69},{"category":27},{"category":27},{"category":27},{"category":27},{"category":181},"Home Assistant",{"category":181},{"category":72},{"category":27},{"category":27},{"category":72},{"category":138},{"category":5},{"category":72},{"category":72},{"category":138},{"category":27},{"category":181},{"category":181},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},{"category":72},191,{"id":205,"title":206,"body":207,"category":427,"date":428,"description":429,"embedImage":427,"extension":430,"image":427,"intro":427,"meta":431,"navigation":432,"path":433,"seo":434,"series":427,"sitemap":435,"stem":436,"tags":437,"__hash__":438},"content\u002F2009\u002F03\u002F01\u002Fmaintaining-upgrading-drupal-installations-with-git.md","Maintaining\u002Fupgrading drupal installations with git",{"type":208,"value":209,"toc":423},"minimark",[210,223,226,229,232,235,247,252,255,260,265,268,272,277,280,284,289,292,295,299,302,305,308,339,342,346,349,412,416,419],[211,212,213,214],"p",{},"This is based on ",[215,216,217],"a",{"href":217,"rel":218,"target":222},"http:\u002F\u002Fwww.versioncontrolblog.com\u002F2007\u002F08\u002F02\u002Fupgrading-drupal-52-with-git\u002F",[219,220,221],"nofollow","noopener","noreferer","_blank",[211,224,225],{},"This is a work in progress\u002Fidea dump right now - any suggestions\u002Fimprovements - please do leave a comment ;)",[211,227,228],{},"I have quite a few sites that are using drupal. I know I could go the route of a multisite install (I've done it before) - but I found that the requirement of upgrading all sites simultaneously was a bit too hard. However - upgrading everything by hand for each site is also poor.",[211,230,231],{},"I've a set of shell\u002Fperl scripts to make life easier - but - this really does feel like a version control issue to me.",[211,233,234],{},"Googling gave me the above link at versioncontrolblog. This is a nice start. But - I can't see how to make it work for many sites. You'd end up with a drupal-and-modules dir per site.",[211,236,237,238,242,243,246],{},"So - here's my initial thoughts. For the following - ",[239,240,241],"code",{},"\u002Fusr\u002Flocal\u002Fdrupal"," is where I'm storing things, ",[239,244,245],{},"\u002Fsrv\u002Fwww\u002F\u003Csitename>\u002Fhtdocs"," is where sites have their document root.",[248,249,251],"h2",{"id":250},"releases","Releases",[211,253,254],{},"We have three types of release to retrieve - drupal itself, modules and themes.",[256,257,259],"h4",{"id":258},"drupal","Drupal",[211,261,262],{},[239,263,264],{},"\u002Fusr\u002Flocal\u002Fdrupal\u002Freleases\u002FdrupalX",[211,266,267],{},"This is a git repo that contains the latest release of drupal major version X. When drupal releases a new version (e.g. drupal 6.9 -> drupal 6.10) then I just extract that on top of the correct major version, git add where necessary then commit. I also tag the result with the major and minor version.",[256,269,271],{"id":270},"modules","Modules",[211,273,274],{},[239,275,276],{},"\u002Fusr\u002Flocal\u002Fdrupal\u002FmodulesX\u002Fmodulename",[211,278,279],{},"For each module that I need (for any site)- this is a git repo (per module) that contains the latest release of the module for drupal major version X. When a module releases a new version (e.g. drupal X.x-1.1 -> drupal X.x-1.2) then I just extract that on top, git add where necessary then commit. I also tag the result with the major and minor version.",[256,281,283],{"id":282},"themes","Themes",[211,285,286],{},[239,287,288],{},"\u002Fusr\u002Flocal\u002Fdrupal\u002FthemesX\u002Fthemename",[211,290,291],{},"For each theme that I need (for any site) - this is a git repo (per theme) that contains the latest release of the theme for drupal major version X. When a theme releases a new version (e.g. drupal X.x-1.1 -> drupal X.x-1.2) then I just extract that on top, git add where necessary then commit. I also tag the result with the major and minor version.",[211,293,294],{},"The idea of the themes and modules directories here is that I should only need to work with one copy of each despite having more than one site. However I don't want every site to update to a newer module at the same time. So now let's see how this gets used for the actual sites.",[248,296,298],{"id":297},"sites","Sites",[211,300,301],{},"Each site is created by cloning the drupalX release repo. I then configure the settings.php (and add it), and add sites\u002Fall\u002Fthemes and sites\u002Fall\u002Fmodules directories (and add them). You may also choose to add sites\u002Fdefault\u002Ffiles to the git ignore list - depends if you want uploads and cached js\u002Fcss\u002Ftheme files to be git controlled over time.",[211,303,304],{},"Updates to drupal can then be handled with git pull.",[211,306,307],{},"To add a theme or module I can then run e..g",[309,310,315],"pre",{"className":311,"code":312,"language":313,"meta":314,"style":314},"language-shell shiki shiki-themes github-dark","git submodule add \u002Fusr\u002Flocal\u002Fdrupal\u002FmodulesX\u002Fpathauto sites\u002Fall\u002Fmodules\u002Fpathauto\n","shell","",[239,316,317],{"__ignoreMap":314},[318,319,322,326,330,333,336],"span",{"class":320,"line":321},"line",1,[318,323,325],{"class":324},"svObZ","git",[318,327,329],{"class":328},"sU2Wk"," submodule",[318,331,332],{"class":328}," add",[318,334,335],{"class":328}," \u002Fusr\u002Flocal\u002Fdrupal\u002FmodulesX\u002Fpathauto",[318,337,338],{"class":328}," sites\u002Fall\u002Fmodules\u002Fpathauto\n",[211,340,341],{},"Remember git submodule init\u002Fupdate if pulling a repo with submodules.",[256,343,345],{"id":344},"to-update-a-module","To update a module",[211,347,348],{},"If a module is updated in the \u002Fusr\u002Flocal\u002Fdrupal\u002FmodulesX then where it is used should also be updated",[309,350,352],{"className":311,"code":351,"language":313,"meta":314,"style":314},"cd \u002Fsrv\u002Fwww\u002F\u003Csite>\u002Fhtdocs\u002Fsites\u002Fall\u002Fmodules\u002F\u003Cmodulename>\ngit remote update\ngit merge origin\u002Fmaster\n",[239,353,354,390,401],{"__ignoreMap":314},[318,355,356,360,363,367,370,374,377,380,382,385,387],{"class":320,"line":321},[318,357,359],{"class":358},"sDLfK","cd",[318,361,362],{"class":328}," \u002Fsrv\u002Fwww\u002F",[318,364,366],{"class":365},"snl16","\u003C",[318,368,369],{"class":328},"sit",[318,371,373],{"class":372},"s95oV","e",[318,375,376],{"class":365},">",[318,378,379],{"class":328},"\u002Fhtdocs\u002Fsites\u002Fall\u002Fmodules\u002F",[318,381,366],{"class":365},[318,383,384],{"class":328},"modulenam",[318,386,373],{"class":372},[318,388,389],{"class":365},">\n",[318,391,393,395,398],{"class":320,"line":392},2,[318,394,325],{"class":324},[318,396,397],{"class":328}," remote",[318,399,400],{"class":328}," update\n",[318,402,404,406,409],{"class":320,"line":403},3,[318,405,325],{"class":324},[318,407,408],{"class":328}," merge",[318,410,411],{"class":328}," origin\u002Fmaster\n",[256,413,415],{"id":414},"to-remove-a-module","To remove a module",[211,417,418],{},"If a module is no longer wanted - edit .gitmodules and .git\u002Fconfig - remove all references. Then git rm --cached \u003Cpath to module>. Finally - remove the module itself.",[420,421,422],"style",{},"html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}",{"title":314,"searchDepth":392,"depth":392,"links":424},[425,426],{"id":250,"depth":392,"text":251},{"id":297,"depth":392,"text":298},null,"2009-03-01 09:32:37 +0100","This is based on http:\u002F\u002Fwww.versioncontrolblog.com\u002F2007\u002F08\u002F02\u002Fupgrading-drupal-52-with-git\u002F","md",{},true,"\u002F2009\u002F03\u002F01\u002Fmaintaining-upgrading-drupal-installations-with-git",{"title":206,"description":429},{"loc":433},"2009\u002F03\u002F01\u002Fmaintaining-upgrading-drupal-installations-with-git",[258,325],"0FWk8PZvOmC3thw7rPFkX9TrItKTX6F0qhIWWk2SkeY",1775293015019]