I am unable to downgrade to older versions

Here i am unable to downgrade to older erpnext version 7.x.x .

:~/frappe-bench$ bench switch-to-branch 'v7.x.x'
Switching for frappe
INFO:bench.utils:git config --unset-all remote.upstream.fetch
INFO:bench.utils:git config --add remote.upstream.fetch '+refs/heads/*:refs/remotes/upstream/*'
INFO:bench.utils:git fetch upstream
INFO:bench.utils:git checkout v7.x.x
Branch v7.x.x set up to track remote branch v7.x.x from upstream.
Switched to a new branch 'v7.x.x'
INFO:bench.utils:git merge upstream/v7.x.x
Already up-to-date.
Branch v7.x.x does not exist in Upstream for erpnext
Successfully switched branches for:
Switched to v7.x.x
Please run `bench update --patch` to be safe from any differences in database schema

Frappe is downgraded to older one but it says Branch v7.x.x does not exist in Upstream for erpnext .

when i go to apps folder and tried git branch -r for frappe it showed all remote branches.

But when I tried the same for erpnext it said only
~/frappe-bench/apps/erpnext$ git branch -r

no other branches is shown in remote.

So i was not able to downgrade it to older one. I have to migrate my project from one server to another for which i need older version 7.

Is there any way?

Hi @ninjas,

Maybe your git repo is restricted to the master branch. Open the file /home/frappe/frappe-bench/apps/erpnext/.git/config and make sure the wildcard (*) is set for the branches, something like this:

       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
[remote "upstream"]
       url = https://github.com/frappe/erpnext.git
       fetch = +refs/heads/*:refs/remotes/upstream/*

If you have master where the * is, this will only allow the specific branch. Run

$ git fetch

after changing this and you should find the other branches.

Hope this helps.

In addition to what @lasalesi has posted, you may need to fetch the major version branch of 7. The Frappe team creates a branch for each major version:

git checkout v7.x.x after you’ve fetched

You don’t want to downgrade from a new version to an old version - there will be a lot of problems. If you want to install an older version. you’ll want to start with the older version.

You’re not going to be able to use the simple setup options. There’s a lot of useful content at Have the Dev's come up an easy way to install the last stable v9? about this

Thanks @lasalesi, This Worked for me.