Backup Restore Error from v13 to v14

I was using version v13 but I dont know why I felt that i should upgrade. And I did it via the following link.

This person also posted on the forum with the same instructions.

Anyhow, i was not able to update, I was getting the error
pymysql.err.ProgrammingError: (1146, “Table ‘_b7b324d5487a1a21.tabFeedback’ doesn’t exist”)

So I did a force reinstall. Now the new v14 which is fully updated and is BLANK is working.

The issue is that I do have a DB backup file but when I restore it via the bench restore command, I get Internal Server Error.
In web.error.log I get the same error. Now I am stuck with no ERP and no data backup.
After Restore when I do a bench migrate, I get the following:

Migrating mysite
Executing frappe.patches.v14_0.setup_likes_from_feedback in mysite (_b7b324d5487a1a21)
Building search index for mysite
Retrieving Routes : [========================================] 100%
Building Index : [========================================] 100%
Traceback (most recent call last):
File “/usr/lib/python3.10/runpy.py”, line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File “/usr/lib/python3.10/runpy.py”, line 86, in _run_code
exec(code, run_globals)
File “/home/frappe/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 109, in
main()
File “/home/frappe/myfrappe/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=“bench”)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 829, in call
return self.main(*args, **kwargs)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 782, in main
rv = self.invoke(ctx)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/core.py”, line 610, in invoke
return callback(*args, **kwargs)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/click/decorators.py”, line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File “/home/frappe/myfrappe/apps/frappe/frappe/commands/init.py”, line 29, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/home/frappe/myfrappe/apps/frappe/frappe/commands/site.py”, line 552, in migrate
SiteMigration(
File “/home/frappe/myfrappe/apps/frappe/frappe/migrate.py”, line 175, in run
self.run_schema_updates()
File “/home/frappe/myfrappe/apps/frappe/frappe/migrate.py”, line 41, in wrapper
ret = method(*args, **kwargs)
File “/home/frappe/myfrappe/apps/frappe/frappe/migrate.py”, line 110, in run_schema_updates
frappe.modules.patch_handler.run_all(
File “/home/frappe/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 75, in run_all
run_patch(patch)
File “/home/frappe/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 62, in run_patch
if not run_single(patchmodule=patch):
File “/home/frappe/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 150, in run_single
return execute_patch(patchmodule, method, methodargs)
File “/home/frappe/myfrappe/apps/frappe/frappe/modules/patch_handler.py”, line 186, in execute_patch
_patch()
File “/home/frappe/myfrappe/apps/frappe/frappe/patches/v14_0/setup_likes_from_feedback.py”, line 7, in execute
if frappe.db.count(“Feedback”) > 20000:
File “/home/frappe/myfrappe/apps/frappe/frappe/database/database.py”, line 1102, in count
count = self.sql(query, debug=debug)[0][0]
File “/home/frappe/myfrappe/apps/frappe/frappe/database/database.py”, line 218, in sql
self._cursor.execute(query, values)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 148, in execute
result = self._query(query)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/cursors.py”, line 310, in _query
conn.query(q)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 548, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 775, in _read_query_result
result.read()
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 1156, in read
first_packet = self.connection._read_packet()
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/connections.py”, line 725, in _read_packet
packet.raise_for_error()
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/protocol.py”, line 221, in raise_for_error
err.raise_mysql_exception(self._data)
File “/home/frappe/myfrappe/env/lib/python3.10/site-packages/pymysql/err.py”, line 143, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1146, “Table ‘_b7b324d5487a1a21.tabFeedback’ doesn’t exist”)

I thought the tabFeedback is not in the old DB so I check the new sql file and this table doesnt exist there also. So I cannot just copy the table and make in the old one.

Can anyone please help me?
Its a request.

Regards,

I know everyone is busy, but please do reply.

In case you didn’t have tabFeedback in the old database, just skip this patch by returning early from the execute function:

def execute():
    return
    # other code

Thanks for the reply, but I dont get it, where do I put this code ?
sorry but I am not that technical :frowning:

Do you mean that I just upload the old sql.gz fle and do what you have told me somewhere ?

am not sure but i think , you have cuztomizations in your older version
for example in some doctype you have the cuztamization done like extra childtable or cuztom field.
when you are migrated to new 14v its the venilla version with no such filed exist.
but there a complete table value which exisit in your sql file…

i have question how did you migrated from 13v to 14v ?

I only did the customization in the Employee. And didnt add any Feedback form or anything like that.
And yes, i migrated from v13 to 14. I wanst successful. So I wiped out (after taking the backup) in a hope that it will restore.

I followed the instruction from the following link.

1 Like


please note in point 2 there should be no customizations

Understood.
It means that I can never upgrade ?

And in employee i just added some small things like a field that adds a National Card Number etc. Nothing hush hush stuff

1 Like

sorry bro am not that much knowledgeable person to say about the upgrades. but i can give you a way out.

if you have the old app in git , use you local to upload the data you have ,
import the employee data. with that custom field data
then delete the field.
now take the backup.
try to paste this sql in the 14v
if it pass then once you are in system, create the filed again and import the data with update data option.

in this way you can get the data and also migrate to new version.
its a way around but you can achieve the goal you targeting .

@Samuvel_Ramesh
Thanks buddy
Yesterday I installed a fresh v13 and simply restored the sql file. Did a bench migrate and everything started working again. I have to do the settings of attendance again but its ok.

I will not update until i have more than 1 reason.
By the way, the route you told, I personally feel that it is doable. but its gonna be hectic. Still, if you can achieve the ultimate goal, a hectic task will be worth it.
Thanks for your time. :slight_smile:

Regards,

you didn’t do bench migrate ?
i mean the last time when you encountered the error.

anyhow its good that you have solved.

i did. it was giving the error when i did migrate

1 Like

I have done this task.

What i have done, once install fresh v13 then restore ur backup and migrate.

once success then switch to branch v14.

1 Like

I have checked my version 13 Database, there is no table named as tabFeedback.

What I tried was, I wiped the DB and made the version 14 fresh (upgraded from version 13); and tried to restore the data of an ERP which had no modifications, version 14 still gave me the above mentioned error.

Can anyone put some light on it ?
Do you suggest that I install a 100% fresh v14 ? - and if this is the case is there any nice guide for that?

The file from your traceback is here
/home/frappe/myfrappe/apps/frappe/frappe/patches/v14_0/setup_likes_from_feedback.py

So maybe just go into that file and return early. Though if you ask me I wouldn’t do that until I know for sure what that patch is doing