<div dir="ltr"><div>All the migrations are shipped with pulpcore[0] and will be installed when you install pulpcore 3.15 in the new virtual env. The database has a table that keeps track of which migrations have already been applied to it. The installer will apply only the new migrations. Did I understand your question correctly?<br></div><div><br></div><div>[0] <a href="https://github.com/pulp/pulpcore/tree/master/pulpcore/app/migrations">https://github.com/pulp/pulpcore/tree/master/pulpcore/app/migrations</a></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 4:01 PM Bin Li (BLOOMBERG/ 120 PARK) <<a href="mailto:bli111@bloomberg.net">bli111@bloomberg.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="white-space:pre-wrap;font-size:small;font-family:"Courier New",Courier,"BB.FixedWidth"">Thanks Mike. What you described is what we plan to do. I do see the migration historical files. They are under ../venv/pulp/3.7 in our case. It is a virtual environment used by the pulp_installer.  We set the pulp_install_dir to this directory.  Since we are upgrading python to 3.8 for pulp 3.15.  We set the pulp_install_dir to  a new ../venv/pulp/3.8. Because this is a new python install dir, I am not sure how pulp_installer know where to find the historical file under the old ../venv/pulp/3.7. Could this be an issue for the migration?<br><br><div style="font-size:small;font-family:"Courier New",Courier,"BB.FixedWidth""><div><div><div>From: <a href="mailto:mikedep333@redhat.com" target="_blank">mikedep333@redhat.com</a> At: 09/20/21 12:21:22 UTC-4:00</div>To: <a href="mailto:bli111@bloomberg.net" target="_blank"> Bin Li (BLOOMBERG/ 120 PARK ) </a><br>Cc: <a href="mailto:pulp-list@redhat.com" target="_blank"> pulp-list@redhat.com</a><br>Subject: Re: [Pulp-list] pulp3 migration directory</div><br></div><div style="background:white none repeat scroll 0% 0%;color:black;font-family:Arial,"BB.Proportional";font-size:small;white-space:normal"><div><blockquote><div dir="ltr">Hi Bin,<div><br></div><div>We are trying to understand what you are asking exactly.</div><div><br></div><div>It sounds like:</div><div>1. you have a test environment with a copy of the production database.</div><div>2. You upgraded pulp on the test environment. During this, the migrations were ran by pulp_installer against the test database copy.</div><div>3. You will run the upgrade pulp on the production environment, which will upgrade the production database.</div><div><br></div><div>So we have all the possibly needed migration files on disk. They are static, and are part of the pypi packages (and RPM packages too.) This is a change from the pulpcore 3.0 alpha/beta/rc behavior, when we generated the migrations.</div><div><br></div><div>If you run `find /usr/local/lib/pulp | grep migrations` , you will see all of them. You'll see both compiled .pyc files and the original .py files.</div><div><br></div><div>When the installer runs, it runs all the needed migrations. This is part of the pulp_database_config role, the task is named "Run database migrations".</div><div><br></div><div>roles/pulp_database_config/README.md still refers to the pulpcore 3.0 alpha/beta/rc behavior when it says that it "Create and run migrations." It only runs them now. I will fix this doc.</div><div><br></div><div>Does this answer your questions?</div><div><br></div><div>-Mike</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 16, 2021 at 4:52 PM Bin Li (BLOOMBERG/ 120 PARK) <<a href="mailto:bli111@bloomberg.net" target="_blank">bli111@bloomberg.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="font-size:small;font-family:"Courier New",Courier,"BB.FixedWidth";white-space:pre-wrap">The 3.15 release requires python 3.8. We are currently running pulpcore 3.7 with python 3.7 and an external db. When we use the pulp_installer to migrate the older release to 3.15 with new python 3.8 venv,it run successfully in a test environment. I am wondering how the new version knows the the historical migration file. Should I copy the historical migration files from older python 3.7 venv to the new 3.8 venv first?</div>_______________________________________________<br>Pulp-list mailing list<br><a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br><a href="https://listman.redhat.com/mailman/listinfo/pulp-list" target="_blank">https://listman.redhat.com/mailman/listinfo/pulp-list</a></blockquote></div><br><div><br></div>-- <br><div dir="ltr"><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:capitalize"><span>Mike</span> <span>DePaulo</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px 0px 4px;text-transform:capitalize">He / Him / His</p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px;text-transform:capitalize"><span>Service Reliability Engineer, Pulp</span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px 0px 4px;font-size:12px"><a style="margin:0px" href="https://www.redhat.com/" target="_blank">Red Hat</a></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-bottom:4px"></div><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;margin:0px;font-size:12px"><span>IM: <span>mikedep333</span></span></p><p style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:12px;margin:0px"><span>GPG: 51745404</span></p><div style="color:rgb(0,0,0);font-family:RedHatText,sans-serif;font-size:medium;margin-top:12px"><table border="0"><tbody><tr><td width="100px"><a href="https://www.redhat.com/" target="_blank"><img src="https://marketing-outfit-prod-images.s3-us-west-2.amazonaws.com/f5445ae0c9ddafd5b2f1836854d7416a/Logo-RedHat-Email.png" style="width: 90px;" width="90"></a></td></tr></tbody></table></div></div></div></blockquote><br></div></div></div></div></div>_______________________________________________<br>
Pulp-list mailing list<br>
<a href="mailto:Pulp-list@redhat.com" target="_blank">Pulp-list@redhat.com</a><br>
<a href="https://listman.redhat.com/mailman/listinfo/pulp-list" rel="noreferrer" target="_blank">https://listman.redhat.com/mailman/listinfo/pulp-list</a></blockquote></div>