It started working correctly after I deleted everything from Posts, Media, Pages, Comments, Widgets, Menus, Elements and Plugins and then imported it again. There was no error and now it’s imported correctly.
Also, I wanted to know where should I paste this –